Sim aims to make circuit design as simple and fun as possible by using intuitive interfaces and powerful abstractions. Sim is created as a part of the Crafting Computer course.
Try the online Sim editor here!
We welcome all questions, suggestions, issues, and pull requests.
- Follow instructions here to install
Elm
which is powers the Sim compiler and editor. - Follow instructions here to install
elm-live
which is used for building and running Sim.
- Run editor:
sed -i 's+src="elm.js"+src="/public/elm.js"+' public/index.html
elm-live src/Editor.elm --start-page public/index.html -- --output=public/elm.js
- Build optimized version of editor:
./build.sh
Note: you may need to enable execution permission before running the command:
chmod +x ./build.sh
- Run Sim compiler on a source string:
elm-live src/Main.elm --start-page debug/index.html -- --output=debug/elm.js
Thanks to all the wonderful projects below that inspired Sim:
MIT
- Require at least one definition in
defs
, so no empty program or empty let...in expression - Largely fix varSize inference, so stuff like below compiles
test i[i] j[j] k[k] -> [j] = let a = nand i i b = nand j j c = nand k k in b
- Better fit values in truth table
- Keep track of scope levels independent of indentations in emitter
- Add number format dropdown for truth table
- Show numbers in truth table in their sizes (pad 0 and 1 if needed)
- Detect mutual recursive definitions and emit specific outputs for them
- Detect varSize casting problems (approach having decent type inference)
- Move tutorial to a separate ebook
- Make README specific to Sim
- Constrain VarSize names to the function they are defined in
- Add ALU tutorial
- Add concatenation operator (++)
- Fix binary parsing and display
- Fix line comment newline counting problem
- Add busLiteral expression, e.g. [0, 1, 0, 0]
- Better generate and display truth tables of different sizes
- Lock caption and header of truth table when scrolling
- Fix indentation checking for record, intLiteral, and bindingOrCall
- Detect binding record assignment mismatches
- Pop parameters and local names from context when out of scope
- Fix the emitted JS of indexing expr another time
- Fix indexing on IntSize type inference
- Filter out duplicated parser problems
- Fix the emitted JS of indexing expr
- Fix EqualToSize comparison in unify
- Check for duplicated names
- Properly show 2's complement in decimal in truth table
- Add fill function to prelude
- Allow spaces inside parenthesized group expr
- Fix some checker error messages
- Store units in localStorage
- Can remove tabs
- Fix parse error underlining