大概的意思其实是我第一眼觉得 Hs 不必要的复杂化了问题但没有提升性能和易读性的其中之一(我理解 hs 恐怕还需要很长一段时间)
人家搞一大堆「新概念」,但未必为简化程序结构、提升表现力做了提升,反而可能是个坑,所以就直接喷了
Haskell 还表示自己是要搞 Industrial 的,可是,我没见过真的使用 Haskell 框架的后端工程师... (即使这样,我居然还能看到阮一峰的 FP 入门教程... 厉害)
果断去喷一波 FP
人家搞一大堆「新概念」,但未必为简化程序结构、提升表现力做了提升,反而可能是个坑,所以就直接喷了
Haskell 还表示自己是要搞 Industrial 的,可是,我没见过真的使用 Haskell 框架的后端工程师... (即使这样,我居然还能看到阮一峰的 FP 入门教程... 厉害)
果断去喷一波 FP
randomSum = do
x <- randomInteger
y <- randomInteger
pure (x + y)
randomSum = randomInteger >>= (\x ->
randomInteger >>= (\y ->
pure (x + y)))
randomSum = (+) <$> randomInteger <*> randomInteger
这是一段摘录的 Haskell 代码,还有我发现 hs 程序员特别喜欢证明交换律什么的....
比较下 C 和 Java 过程式/面向对象(过程式 + OO 系统...)更像平时我们解决问题的方式,数学的则更理想化一些,所以还搞个 Monad 函子屏蔽副作用,纯纯 naive 的世界
(233) #Ruby 里的 Fiber 不就是 Lua 里的 coroutine 嘛(
现在还不理解 coroutine 和基本的生产者 - 消费者队列,所以不能下结论
现在还不理解 coroutine 和基本的生产者 - 消费者队列,所以不能下结论
Fibers are primitives for implementing light weight cooperative
concurrency in Ruby. Basically they are a means of creating code blocks
that can be paused and resumed, much like threads. The main difference
is that they are never preempted and that the scheduling must be done by
the programmer and not the VM.
As opposed to other stackless light weight concurrency models, each
fiber comes with a stack. This enables the fiber to be paused from
deeply nested function calls within the fiber block. See the ruby(1)
manpage to configure the size of the fiber stack(s).