- Error messages about output being different from the expected use some sort of very explicit printing mode with lots of quotes and escaping. A message saying that one got "\\\'\\\'" where "\'\\\\'" was expected is needlessly hard to parse when the actual difference is \'\' vs. '\\' (or whatever).
- Many parts are marked optional, but the test script complains if you don't implement them, and later sections assume that they are implemented, so you have to treat them as compulsory anyway.
- Some things regarding environment updates were contradictory or at least not explained properly at first, with some very relevant information only coming later. I don't remember the specifics, but the problem was roughly that I set up my data structures thinking that everything could be implemented in a pure way, but at some point it became clear that you either need some other data structure or must use destructive modifications.
- Do you have some specific examples? The test cases are marked as either deferrable or optional. You shouldn't ever have to implement optional (and if so that's a bug in the tests or the guide). I think the deferrable items are marked pretty clearly in the guide where they become mandatory in later steps. If it's not clear, then that's a bug.
- This is one of the tensions that exists with trying to make the guide incremental; later features may require re-work of earlier functionality. I do try and minimize that as much as possible although I've found it can really vary depending on the nature of the target language. Note that the primary goal of mal/make-a-lisp is pedagogical (as opposed to say "the easiest way to make your own Lisp"). So sometimes the need to go back and re-work something is in line with that goal.
If you have any concrete guide text or test driver improvements (especially that further the pedagogic goals of mal), I'm always happy to review pull requests! :-)
Mal – Make a Lisp, implemented in 79 languages - https://news.ycombinator.com/item?id=21670442 - Nov 2019 (11 comments)
Mal – Make a Lisp, in 68 languages - https://news.ycombinator.com/item?id=15226110 - Sept 2017 (69 comments)
Mal – Make a Lisp - https://news.ycombinator.com/item?id=12720777 - Oct 2016 (1 comment)
Make a Lisp - https://news.ycombinator.com/item?id=9121448 - Feb 2015 (41 comments)
Lisp implemented in under 1K of JavaScript - https://news.ycombinator.com/item?id=9109225 - Feb 2015 (16 comments)
I think with Regex101 in my back pocket I'll give it another try.
static public List<string> Tokenizer(string source)
{
// Initialise the token list.
List<string> tokens = new List<string>();
// Define a regex pattern whose groups match the MAL syntax.
string pattern = @"[\s ,]*(~@|[\[\]{}()'`~@]|""(?:[\\].|[^\\""])*""|;.*|[^\s \[\]{}()'""`~@,;]*)";
// empty ~@ | specials | double quotes |; | non-specials
// Break the input string into its constituent tokens.
string[] result = Regex.Split(source, pattern);
This took a while to understand and get going but it really improved my understanding of regex.But yeah, that shouldn't be where you get stuck.
Step 0, so I didn't get very far.
https://github.com/kanaka/mal/blob/master/process/guide.md#s...
There are online tools to help visualize regex's. Here is a recent tweet including a visualization of mal's tokenizer regex: https://twitter.com/Mehulwastaken/status/1382292764834996230
It's a big step.
https://github.com/kanaka/mal/blob/master/process/guide.md#s...
I like parsing, I like regexes but I agree it's often a waste of time :)
APL/J/Kx
Verilog
Fortran
LISP 1.5Might be a fun project!
I was massively pleased when I got MAL to self-host.
[0] https://www.non-kinetic-effects.co.uk/blog/2019/04/28/MAL-5
[1]: https://michaelnielsen.org/ddi/lisp-as-the-maxwells-equation...
Example: No seas vencido por el mal, sino vence con el bien el mal.
Do not be overcome by evil, but overcome evil with good.