5 ms·
Somewhat OT, but one of my pet crazy ideas is a Forth-like data file format based on a stack. I've never thought about it enough to say if it's completely stupi
by kumarsw 6y ago
Somewhat OT, but one of my pet crazy ideas is a Forth-like data file format based on a stack. I've never thought about it enough to say if it's completely stupid or not.
- iujjkfjdkkdkf 6y agoCould you elaborate a bit? Would the file be a set of instructions that generates the data (this is how postscript works), or something else?
- kumarsw 6y agoI was thinking some some subset of a stack-based language, enough to define different data types, eg. arr_name 1 2 3 4 5 array; float_name 5.75 float Sort of like how Clojure or KiCad uses S-expressions to store data. The idea was that like Forth, the parser for such a data structure would be minimal and suitable for even a crappy programmer to implement. I'd thought this would be useful for minimal systems like microcontrollers or locked-down corporate systems with no chance of installing third-party libraries.
- iujjkfjdkkdkf 6y agoInteresting - if you had a parsing language defined, you could combine raw data with transformations, e.g. float_name 5.75 DUP MUL float so the transformed data gets loaded in. Could be cool for arrays or more complex data where you want to save the raw data and a record of how it gets transformed. And I understand you are targeting a minimal implementation, but the concept could also apply to bigger datasets and higher level languages, e.g. array_name 1 2 3 4 5 "x if x%2 ==0" array