1brc in SPITBOL #155
Replies: 2 comments 2 replies
-
That's impressive for a single-threaded, dynamically typed language. Is SPITBOL generally a fast language? |
Beta Was this translation helpful? Give feedback.
-
SPITBOL is a "compiled" version of SNOBOL, and was designed to be very efficient and fast SPITBOL itself is written in a pseudo assembly language called minimal. There is a minimal -> x86_64 nasm "assembler" Digging into the innards, it's more of a JIT implementation Basically, SPITBOL takes a statement during the "compile" phase and creates a list of internal code blocks that perform the individual operations -- using some kind-of-C it looks like:
The "execute-statement" looks something like:
And then the individual routines look something like: xxx So given the statement: The codewords for this statement would be a bunch of "pointers" to static code
So a "_vlk" is a variable block, which contains an internal pointer to the code that "knows" how to get a value, or assign a value to that variable, etc. Here is the actual code for implementation for the addition operation (in nasm)
|
Beta Was this translation helpful? Give feedback.
-
I was wondering how well SPITBOL (an implementation of SNOBOL) would do.
The only real optimization done was using integer arithmetic by first multiplying the temperature by 10 and then "formatting" the values.
SPITBOL (SNOBOL) doesn't support theads, it handles it's own storage management, and uses dynamic data typing.
Intel Xeon 3.4Ghz 4 core
For reference:
Beta Was this translation helpful? Give feedback.
All reactions