4 ms·
Why is Oil implemented in Python? IMO Python is a terrible language for writing programming languages.
by oleks 9y ago
Why is Oil implemented in Python? IMO Python is a terrible language for writing programming languages.
- oblio 9y agoWhy?
- GhostVII 9y agoMaybe because python is very slow?
- mattgreenrocks 9y agopypy gives decent speed, and RPython is quite impressive. But I'm sure it is ease of prototyping and exploring the design space.
- Myrmornis 9y agoFor this to be relevant you'd have to explain that you expect the shell process itself to be doing a lot of CPU-bound work.
- chubot 9y agoI will address that in part 2 of the FAQ, but the short answer is: 1) I prototyped it in Python; the dependency on the Python interpreter will be removed [1] 2) Oil went through many implementation languages, and one incarnation was 2000-3000 lines of C++. But I realized I would NEVER finish that way. The goal is to be compatible with bash, which is a tall order. 3) Oil is heavily metaprogrammed. It's only 16K lines of Python, compared to 160K lines of bash, and it can run some of the most complex bash programs out there. [2] It's more accurate to say Oil is written in Python + ASDL [3], i.e. somewhat in the style of ML. [1] https://news.ycombinator.com/item?id=16277358 https://news.ycombinator.com/item?id=16277358 [2] http://www.oilshell.org/blog/2018/01/15.html http://www.oilshell.org/blog/2018/01/15.html [3] http://www.oilshell.org/blog/tags.html?tag=ASDL#ASDL http://www.oilshell.org/blog/tags.html?tag=ASDL#ASDL
- deleted 9y ago[deleted]
- Myrmornis 9y agoIf you expect the shell process itself to be doing a lot of CPU-bound work, then that might be a reason against using an interpreted language like python. If you expect the shell process to need to make use of true thread-based concurrency, then that might be a reason not to use python. Do we have either of the above expectations? What other reasons are there for python to be inappropriate?