« first day (1911 days earlier)      last day (157 days later) » 

02:57
hyper-neutrino has unfrozen this room.
A
Shouldn't be that hard to adapt the syntax highlighter to a CodeMirror parser
 
12 hours later…
14:48
Let's see if this behemoth of a new room description works...
Lol--tried to save it and got an error page. :P
room topic changed to tinylisp: Discussion of languages in the tinylisp family. tio.run/#tinylisp | replit.com/@dloscutoff/tinylisp2 | tio.run/#appleseed [awesome] [functional-programming] [lisp] [minimalism] [parentheses] [tail-recursion]
So yeah--very very alpha version of tinylisp 2 is out and can be demoed on Replit! Most of the core language is there, it's just missing a lot of the "nice" features and a lot of library functions.
2
New features include lexical scope, better macro system, syntax for default arguments, a dedicated String type, ; for comments, and autoloading the core library.
Note that many of the builtins now use long names by default (e.g. cons instead of c); the library with the single-character versions is not autoloaded yet, but for the present it can be manually loaded with (load lib/short-names).
 
2 hours later…
16:43
@DLosc does this mean, (load library) is not required?
Correct!
nice
@DLosc so will you add string functions to lib?
@DLosc can you make the repl support multiline stuff like the python repl?
@PyGamer0 Yes--note also that because of how strings are implemented, some string operations are just the same as the corresponding list operations. For example, reverse and concat work on both strings and lists.
@PyGamer0 Yeah, that's something I'll look at adding. Though I do also like the autocomplete-at-end-of-line feature... I wonder if there's a way to have both.
16:50
@DLosc wdym autocomplete at the end of the line?
@DLosc why is ~ reverse?
@PyGamer0 Try typing (cons "abc" (list "def" "ghi
oh autoclosing automatically
@PyGamer0 ~ is "swap" in some languages--it seemed to fit the "put the end at the beginning and the beginning at the end" idea. I'm open to other suggestions.
| for reverse?
I was saving that for or
16:54
oh ok
@DLosc how about $ ?
That's a possibility. I had tentatively associated $ with macro, but 1) that's flexible, and 2) I'm not sure whether macro needs a 1-character version. I don't think it'll be used much in golf.
ok keep ~ as is. i am fine with that
what is the macro syntax?.
Basically, macros and functions have switched syntax from original tinylisp. Functions are now lists of three elements (environment params body), and macros are lists of two elements (params body).
Speaking of macros: in library code, I like prefixing the names of macro arguments with a sigil to distinguish them from functions. Onions on & vs $? (Or another option?)
E.g. (macro (&num) (- &num 1)) vs (macro ($num) (- $num 1))
17:17
@DLosc so this is less like a bare minimum lisp i see
must've been fun practice writing an interpreter for this.
17:33
@Razetime Yeah--it's still pretty minimal (around 20-22 builtins as compared to 17 in tinylisp 1), but it has a few more capabilities. Lexical scope is so nice (and a lot easier to implement than I thought it would be).
I copied large parts of the structure of the interpreter from Appleseed, which already had a number of the same improvements over tinylisp (as well as a bunch of other stuff which I didn't want for tinylisp 2).

« first day (1911 days earlier)      last day (157 days later) »