Commit Graph

1604 Commits

Author SHA1 Message Date
greg
48b0b8d053 Add logic for picking language with command line flags 2017-09-19 22:11:01 -07:00
greg
e0c49abe56 Change show-llvm opt to -v 2017-09-19 22:11:01 -07:00
greg
65dc362a1d Killed some warnings, cleaned up some code 2017-09-19 22:11:01 -07:00
greg
8ff1c632c2 Make REPL friendlier 2017-09-19 22:11:01 -07:00
greg
039022bfc5 Get rid of println 2017-09-19 22:11:01 -07:00
greg
387ec25cda Fix bugs in interpreter argument parsing 2017-09-19 22:11:01 -07:00
greg
ecf60198fa Can now switch between languages in the interpreter 2017-09-19 22:11:01 -07:00
greg
f83cece2b4 Import Maaru into main 2017-09-19 22:11:00 -07:00
greg
8fd5fb5a0b Added language name functionality 2017-09-19 22:11:00 -07:00
greg
455fe2abe2 Get rid of stand alone evaluator 2017-09-19 22:11:00 -07:00
greg
902c85ccd7 Fully implemented state
If I make the LanguageInterface trait over a pair of language and
evaluator, then it works :)
2017-09-19 22:11:00 -07:00
greg
4ea600d55c Abstracted most work into LanguageInterface trait
Still need to handle state
2017-09-19 22:11:00 -07:00
greg
6dec35d460 Think I've nearly gotten it traitified correctly... 2017-09-19 22:11:00 -07:00
greg
cc855affbf Make Maaru structs public 2017-09-19 22:11:00 -07:00
greg
a303aa2a5b Add first new language - Maaru
Maaru is intended to be a haskell-ish functional language.
Here's enough of a skeleton to print a thing
2017-09-19 22:11:00 -07:00
greg
421a9a7e9b Abstract evaluation into EvaluationMachine trait 2017-09-19 22:11:00 -07:00
greg
f37ab80163 Fix tests 2017-09-19 22:11:00 -07:00
greg
178434171e Cleaning up some types 2017-09-19 22:11:00 -07:00
greg
fd4610e175 Make newtype for LLVM code strings 2017-09-19 22:11:00 -07:00
greg
5103f03fa5 Forgot to add mod.rs file 2017-09-19 22:11:00 -07:00
greg
1a4bf24ab1 Move schala-specific stuff into its own module 2017-09-19 22:11:00 -07:00
greg
9d6bdf22da More conversions to trait version 2017-09-19 22:11:00 -07:00
greg
8326a12c9c (Largely) trait-ify Schala
The idea is to provide a trait `ProgrammingLanguage` that actually does
all the work, and then main.rs will just be the infra for storing its
own state
2017-09-19 22:11:00 -07:00
greg
5e474231da ProgrammingLanguage types need Debug 2017-09-19 22:11:00 -07:00
greg
1ac440c8df Implement trait parse 2017-09-19 22:11:00 -07:00
greg
f5022a771c Starting work to trait-ify language 2017-09-19 22:11:00 -07:00
greg
eaf86ea908 Add support for +, - in num literals 2017-09-19 22:11:00 -07:00
greg
eb6354e55a Only print errors if the programs failed 2017-09-19 22:11:00 -07:00
greg
751c6f65bd Deleted some code in compilation 2017-09-19 22:11:00 -07:00
greg
3e231b4715 Use native rust to write source file 2017-09-19 22:11:00 -07:00
greg
e103ba221c Conditionals work! 2017-09-19 22:11:00 -07:00
greg
d5f01a7b1f Continuing work on phi nodes 2017-09-19 22:11:00 -07:00
greg
1702163478 Add flag for llvm 2017-09-19 22:11:00 -07:00
greg
bdd6f75cf6 Show/hide LLVM IR in REPL 2017-09-19 22:11:00 -07:00
greg
2681dbc4f2 Add test for "a+4" being conterintuitive
Also fix Op -> BinOp in tests
2017-09-19 22:11:00 -07:00
greg
9454fc6194 Add return statements to generated functions 2017-09-19 22:11:00 -07:00
greg
c8feaa9b57 Add logging of supplimental commands 2017-09-19 22:11:00 -07:00
greg
518414ffd5 I was doing a wrong thing with creating vecs
The old vector was getting dropped and thus free-ing the old
underlying slice. I want to use set_len() on Vec to do
this
2017-09-19 22:11:00 -07:00
greg
06a5de6e32 Trying to debug this segfault 2017-09-19 22:11:00 -07:00
greg
dd4816624c Change name of project to Schala 2017-09-19 22:11:00 -07:00
greg
748a85db02 Compiling functions half-works 2017-09-19 22:11:00 -07:00
greg
8f2d9b900b Function codegen sorta works 2017-09-19 22:11:00 -07:00
greg
b9d1140264 Refactored op compilation code
+ moved to separate function
2017-09-19 22:11:00 -07:00
greg
7188a7d33e Clarified that we hardcode a "main" function
in compiler data structure
2017-09-19 22:10:59 -07:00
greg
0c7099771f Comparison operator working 2017-09-19 22:10:59 -07:00
greg
afec7e829c There's some segfault happening in LLVMBuildUIToFP 2017-09-19 22:10:59 -07:00
greg
a6773d59bd Refactoring in compiling binops 2017-09-19 22:10:59 -07:00
greg
d804efdc5e Use BinOp type instead of strings 2017-09-19 22:10:59 -07:00
greg
0ace370fc2 Tightened up REPL loop 2017-09-19 22:10:59 -07:00
greg
1f50fcc620 Improvments to interpreter directives parsing 2017-09-19 22:10:59 -07:00