Commit graph

70 commits

Author SHA1 Message Date
Roman Godmaire
02463197c3 misc: Chesterton's Fence
Everything is a list in lisp for a reason 🙃
2024-05-12 08:11:12 -04:00
Roman Godmaire
047db2b188 feat: proc macro to write mute in rust 2024-05-11 13:19:58 -04:00
Roman Godmaire
4f882b35a6 refactor: move arg count
We only use this in the evaluator env, so move it to there.
2024-05-11 07:56:48 -04:00
Roman Godmaire
de4e9b4bd3 refactor: use macros for semi-repeated functions 2024-05-10 21:27:00 -04:00
Roman Godmaire
5669a04db0 feat: return errors on bad operations
The vast majority of these will turn into parse time type checks
2024-05-10 19:23:48 -04:00
Roman Godmaire
1958da3a96 docs: future of errors 2024-05-10 19:00:56 -04:00
Roman Godmaire
c53bb68b13 misc: grammar(?) 2024-05-10 18:56:21 -04:00
Roman Godmaire
2e19a44c0a feat: error node
Errors as values, baby!!
2024-05-10 18:54:18 -04:00
Roman Godmaire
ff6b12e408 lint: clippy 2024-05-10 11:24:45 -04:00
Roman Godmaire
c855b216ee misc: devenv 2024-05-10 11:23:38 -04:00
Roman Godmaire
e54d095c5f refactor!: move specials out of env
This is a fucked up commit.  If you see this, you have fallen too deep
into the rabbit hole.  Come say hi!
2024-05-10 11:21:46 -04:00
Roman Godmaire
d8724eb4b7 refactor: merge imports 2024-05-06 22:36:06 -04:00
Roman Godmaire
872195f6a5 feat: support floats in ordering operators 2024-05-06 22:35:39 -04:00
Roman Godmaire
e4484297a9 misc: remove i128 support
Rather than doing this, we should use a BigNumber library
2024-05-06 22:16:05 -04:00
Roman Godmaire
f1083009a4 refactor: split parser and interpreter into separate crates 2024-05-06 21:51:22 -04:00
Roman Godmaire
e49dbab859 feat: rudimentary float support 2024-05-06 08:50:38 -04:00
Roman Godmaire
1ed451e696 fix: support up to 128-bit integers
Floats should be next
2024-05-06 08:28:46 -04:00
Roman Godmaire
cbdff2c170 lint: clippy fixes 2024-05-06 08:01:18 -04:00
Roman Godmaire
5e072c0773 misc: remove anyhow dependency 2024-05-06 07:57:54 -04:00
Roman Godmaire
7e4166386f refactor: extract CLI to binary
Also start getting rid of anyhow
2024-05-05 11:16:45 -04:00
Roman Godmaire
e9c350e925 feat: quasiquote & unquote
This is an abomination, but it works
2024-05-05 10:31:02 -04:00
Roman Godmaire
66a2905c60 misc: CLI ergonomic improvements 2024-05-05 09:49:12 -04:00
Roman Godmaire
c321bf83d3 docs: Add my name <3 2024-05-05 09:36:50 -04:00
Roman Godmaire
db4bb2de8f feat: actual CLI interface 2024-05-05 09:21:45 -04:00
Roman Godmaire
b3a9bca32d feat: readline support in REPL 2024-05-05 08:36:57 -04:00
Roman Godmaire
00ac922bd0 feat: basic quoting
...  I think this is right?
2024-05-04 21:55:17 -04:00
Roman Godmaire
c596e00be8 feat: eval/apply functions 2024-05-04 21:14:47 -04:00
Roman Godmaire
2d93c83b67 feat: File IO! 2024-05-04 21:14:35 -04:00
Roman Godmaire
936f557536 feat: allow underscores in integers 2024-05-04 19:33:39 -04:00
Roman Godmaire
527737f020 fix: closures are functions, functions are closures 2024-05-04 19:23:25 -04:00
Roman Godmaire
e6b487a09a perf: RC environment
This now means environments are genuinely shared instead of clones
2024-05-04 19:03:14 -04:00
Roman Godmaire
18ea5f34e6 fix: remove dbg statement... 2024-05-04 18:49:40 -04:00
Roman Godmaire
93d53bd2a1 feat: differentiate between functions and closures 2024-05-04 18:45:43 -04:00
Roman Godmaire
b1ddc907e6 fix: don't include void nodes in eval result 2024-05-04 18:45:19 -04:00
Roman Godmaire
b582d66fcf feat: display to print/println 2024-05-04 18:05:22 -04:00
Roman Godmaire
58d1ffe48f feat: do statement for blocks 2024-05-04 18:05:09 -04:00
Roman Godmaire
5bdc677763 lint: referencing a reference 2024-05-04 17:49:02 -04:00
Roman Godmaire
30ebafb89d fix: support if without else
If statements without an else should evaluate to nil if the condition is
not valid.  These are mainly used for side effects, but sometimes you
might want a value.
2024-05-04 17:43:38 -04:00
Roman Godmaire
8ac46f36a8 fix: conditionally run if branches
NativeFunc evaluates the parameters before passing them into the
function, but Specials pass in the raw nodes.  If a function had side
effects (ie. display) then it would run even if the branch wasn't
the one chosen by the condition.
2024-05-04 17:38:40 -04:00
Roman Godmaire
a612bb771b feat: count function for collections 2024-05-04 17:26:26 -04:00
Roman Godmaire
59dfe1e854 feat: empty? func for list, vec, hashmap 2024-05-04 17:24:01 -04:00
Roman Godmaire
92b32ff2df feat: basic string coercion 2024-05-04 17:10:51 -04:00
Roman Godmaire
0af757fa27 test: additional test cases 2024-05-04 17:02:07 -04:00
Roman Godmaire
769cc61d48 feat: add list constructor 2024-05-04 16:52:55 -04:00
Roman Godmaire
c38576b667 refactor: extract env, macros, error, and remove expression
Rather than using expressions, we can instead just parse into nodes then
work with those instead.  Everything in this language is an Expression,
so there's no reason to differentiate between nodes and expressions.
2024-05-04 16:40:02 -04:00
Roman Godmaire
51095f77ed refactor: Extract Node enum to module 2024-05-04 15:23:06 -04:00
Roman Godmaire
5863da677f refactor: move lexer to parser module 2024-05-04 13:13:34 -04:00
Roman Godmaire
4808904571 refactor: prep for switching to Node in evaluator
Involves the following

1. Node True/False to Boolean
2. Removing parser tests
3. Other stuff
4. This is a bad commit
2024-05-04 08:08:37 -04:00
Roman Godmaire
040a2518cc fix: incorrect arg counting for modulo 2024-03-09 08:10:02 -05:00
Roman Godmaire
26ba457e8e chore: rename to mute 2024-03-09 07:55:17 -05:00