由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 成功无偶然啊
相关主题
haskell有潜力成为最好的web framework感觉go最无聊的就是
看了一下Meteor很不错根据调研以及好虫建议
haskell 可以运行在iOS上了求推荐python based framework
最新haskell实现可用40+ coresnode.js快,到底什么是根本的原因?
haskell 怎样解决库的版本问题?谁用过OpenResty?
haskell在生产环境的生产力到底如何?学了一圈lisp, haskell, ruby ,python, lua.发觉还是后两者比较有用
Scala又被鄙视了各个编程语言平均工资(ZT)
lua优势劣势在哪里这次python完胜?
相关话题的讨论汇总
话题: blocking话题: lua话题: were话题: libraries话题: servers
进入Programming版参与讨论
1 (共1页)
g****t
发帖数: 31659
1
Node.js之前,这哥们下的功夫真是不少
BostInno: What were you trying to solve when you created node?
Dahl: I was often involved with writing small event based programs. I liked
the design of event based servers because I felt they were easier to
understand: state is kept in some struct and you go around and around
modifying the state. There were no infinite while loops making blocking
reads or accepts from sockets (which has always struck me as a very strange
pattern). I would be able to make very low latency servers by using only non
-blocking I/O.
There was a good reason why most people did not design programs this way
despite the simplicity and efficiency: they needed to use libraries which
were blocking. Event based program design is an all-or-nothing proposition;
you can pack a lot of I/O into a single OS thread if you're careful to never
block on I/O but if you do then you lock up all of those streams you were
handling. Using a thread for each I/O stream is a lot more forgiving - it
doesn't matter how slow you are in one of them. I wanted to create a system
where people could only use non-blocking I/O.
At the same time I was writing a lot of little HTTP servers based around the
idea of a small, well-tested interruptible HTTP parser. I was frustrated
that I could not get the raw request upload stream from a web server unless
I wrote an Apache or NGINX module. The interruptible parser made it easier
to build a server.
BostInno: Why did you originally choose javascript for node?
Dahl: Originally I didn't. I had several failed private projects doing the
same on C, Lua, and Haskell. Haskell is pretty ideal but I'm not smart
enough to hack the GHC. Lua is less ideal but a lovely language - I did not
like that it already had a lot of libraries written with blocking code. No
matter what I did, someone was going to load an existing blocking Lua
library in and ruin it. C has similar problems as Lua and is not as widely
accessible. There is room for a Node.js-like libc at some point - I would
like to work on that some day.
V8 came out around the same time I was working on these things and I had a
rather sudden epiphany that JavaScript was actually the perfect language for
what I wanted: single threaded, without preconceived notions of "server-
side" I/O, without existing libraries.
g****t
发帖数: 31659
2
这哥们现在也在做deep learning
https://arxiv.org/pdf/1702.00783.pdf
://arxiv.org/pdf/1702.00783.pdf
1 (共1页)
进入Programming版参与讨论
相关主题
这次python完胜?haskell 怎样解决库的版本问题?
Any one knows 'Q Programming Language'?haskell在生产环境的生产力到底如何?
magagop可以看看这些基本golang scheduler的资料Scala又被鄙视了
总觉得python 用缩进定义逻辑block 这种思想很诡异lua优势劣势在哪里
haskell有潜力成为最好的web framework感觉go最无聊的就是
看了一下Meteor很不错根据调研以及好虫建议
haskell 可以运行在iOS上了求推荐python based framework
最新haskell实现可用40+ coresnode.js快,到底什么是根本的原因?
相关话题的讨论汇总
话题: blocking话题: lua话题: were话题: libraries话题: servers