Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In both cases a tool is being adapted for something it wasn't intended for: to write C-style code—specifically, code that works with memory the way C does—in a high-level scripting language.

This way of combining high and low levels within the same program seems qualitatively unlike, say, C++, traditional FFIs, and other answers to this problem. It's fascinating to see it emerge from more than one existing technology.



"Python with C data types" was somewhat of a design goal for Pyrex, the language that Cython followed/built on:

http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ver...


That's fascinating because it is very much about the same problem.


I guess I'm not sure which tool you meant was adapted; Cython (and Pyrex) certainly adapt Python to work more directly with memory, but I would say the style of code in the article is an intended use case of them.

(I also might have undersold the connection between the two, Cython is arguably just a friendly fork (I guess mostly they wanted to move faster))


I just meant that the OP is adapting Python (via Cython) similarly to how FFI-driven LuaJIT adapts Lua. The resulting programming style is different enough from classic Python or Lua that it approaches being a different language—something like an embedded C DSL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: