-- Leo's gemini proxy

-- Connecting to republic.circumlunar.space:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Ideas on how lexing will work in Pepper3


I am trying to practice documentation-driven development in Pepper3, so every time I start on an area, I will write documentation explaining how it works, and include examples that are automatically verified during the build.


I've started work on lexing, since you can't do much before you do that, but in fact, of course, I need to have a command line interface before I can verify any of the examples, so I'm working on that too.


Pepper3

lexing


Lexing is the process that takes a stream of characters (e.g. from a file) and turns it into a stream of "tokens" that are chunks of code like a variable name, a number or a string. (There is more on lexing in my mini programming language, Cell.)


My thoughts so far about lexing are in lexing.md, and current ideas about command line interface are at command_line.md. All very much subject to change.


Headlines:


more on lexing

Cell

lexing.md

command_line.md


Ordinary programmers can write their own lexing rules.

Operators (functions like "+" that find their arguments on their left and right, instead of between brackets like normal functions) are defined at the lexing phase, so any symbol (e.g. "in") can be an operator if you want.

Anything you might want to do with a pepper program, including running it, compiling it, packaging it for an distribution system, should be available as a sub-command of the main pepper3 command line.

The command is "pepper3", never "pepper". If a new, incompatible version comes out, it will be called "pepper4", and they will be parallel-installable, with no confusion.


Originally posted at 2018-02-09 13:14:48+00:00. Automatically generated from the original post : apologies for the errors introduced.


original post

-- Response ended

-- Page fetched on Sun May 19 05:43:22 2024