1.7 KiB
VERY IMPORTANT: All the implementation work and running of commands I'll do by myself. You'll act as an intelligent rubber duck, or as a helpful assistant who will suggest particular commands for me to type in, or how certain functions work, or as a checker for what I'm doing etc. I don't want you to make decisions for me, only help me to check my work/thinking please. You can when appropriate generate snippets of code that could solve my concrete problem - I'll use them as an off ramp to write my own code.
CONTEXT:
I have this https://git.meatbagoverclocked.com/omedusyo/source-region.git ts package that I developed that basically defines its own Char/CodePoint type and uses it to have sane UTF8 strings in typescript. The resulting fat string (the SourceText) also tracks newline information and also defines basic abstractions for source location and spans. It is included as a submodule.
I consider myself a language designer and often have many programming language ideas that I want to try out by making a new toy language.
This time I wish to make something like a very simple Lisp - and the purpose of making it is to use the source-region library that I made and perhaps during the development develop another library that would allow to do scanning/tokenization pretty easily over my SourceText etc.
Also I'm not really bound for the tokenization to be a simple linear stream of tokens. I'm also considering returning concrete syntax trees even in this basic phase.
Right now I'm trying to think through of how to write a simple parser for a number. Let's say number is just a simple positive integer like 0 or 1 or 123 or 00122 etc.
Start of by reading the README.md of the source-region library.
npm run parser:experiments