3 ms·
Yes, Absolutely. However, i am not clear what you mean by "language agnostic"? Obviously Code cannot be language independent but if you can read C then you sho
by rramadass 4y ago
Yes, Absolutely.
However, i am not clear what you mean by "language agnostic"? Obviously Code cannot be language independent but if you can read C then you should be able to translate the data structures/algorithms given in this book to a language of your choice; the difficulty might vary (eg. how would you represent pointers in your language to implement say recursive tree structures?) but it can be done. The data structures/algorithms given in Hanson's book are "industrial strength" with no missing parts (i.e. no exercise left to the reader). So you get complete code all written in the "Literate Programming" style which takes a little getting used to but is eminently worth it.
- jart 4y agoIt is possible to write language agnostic code. Consider SectorLISP which is written in C that's also valid JavaScript See https://justine.lol/sectorlisp2/#evaluation https://justine.lol/sectorlisp2/#evaluation and https://github.com/jart/sectorlisp/blob/c9ce1c54a024ac4774a208a84c9083c3a611825d/lisp.js https://github.com/jart/sectorlisp/blob/c9ce1c54a024ac4774a2... and also https://github.com/jart/sectorlisp/blob/main/lisp.c https://github.com/jart/sectorlisp/blob/main/lisp.c
- rramadass 4y agoPretty Neat! I had come across similar techniques in Arthur Whitney's work (past HN threads). However i interpreted the original "language agnostic" question as maybe wanting to implement the C code in terms of some pseudo-code and hence my question. The phrase also seems to have another meaning: https://en.wikipedia.org/wiki/Language-agnostic https://en.wikipedia.org/wiki/Language-agnostic