100 Commits
Author SHA1 Message Date
zxq5 7b18922cc7 Merge pull request 'Merge compiler and emulator progress from last few months into main.' (#11) from compiler into main
Reviewed-on: #11
2026-02-14 11:54:15 +00:00
zxq5 a0b02cb955 Create tasks.json 2026-02-14 11:50:59 +00:00
zxq5 240f0e553f fixed failing tests
TODO: add comprehensive testing to everything
2026-02-14 11:50:54 +00:00
zxq5 25a59a6b19 fixed clippy lints 2026-02-14 11:50:36 +00:00
zxq5 c67217a6b8 Merge branch 'main' into compiler 2026-02-14 11:09:33 +00:00
zxq5 7ccbd9258f - fixed some clippy lints
- updated comments in compiler codegen
- deleted old dsa compiler outputs
- settings for zed
2026-02-14 11:05:15 +00:00
zxq5 201b18069b continued on register allocator rewrite, slow progress as scoping is
proving to be a challenge
2026-02-14 02:46:29 +00:00
zxq5 d66baf6f99 moved loc 2026-02-13 21:42:59 +00:00
zxq5 75ad04cf95 forgot to commit these 2026-02-10 16:37:33 +00:00
zxq5 8361833b1c broken commit, started working on scopes 2026-02-10 16:33:32 +00:00
zxq5 5e575e2cd8 used claude to write a language spec (syntax and simple examples) for
DSC that we can follow as a reference for implementation.
2026-02-10 10:05:13 +00:00
zxq5 931af90789 - renamed assembler_runner to just assembler
- implemented type parsing including custom types and generics (useless
  for now as we do no semantic analysis)
- implemented struct literal parsing
- implemented struct definition parsing (no generics yet)
- implemented tuple parsing
- registers are now allocated starting from zero
- updated to-dos
2026-02-10 10:03:48 +00:00
zxq5 509b3465f1 docs update 2026-02-09 00:10:49 +00:00
zxq5 22241a5633 - implementation of <var> <op> = <expr> type statements such as `x +=
5`
- implementation of logical and shift operations in parser and codegen.
- implementation of sizeof keyword as unary operator

in progress (non functional)
- implementation of prefix and postfix inc/dec operators

- array access by index (implemented, untested as arrays aren't
  implemented yet). essentially just a pointer write with offset.
- struct/member access (parsing implemented, untested.)
2026-02-09 00:10:37 +00:00
zxq5 e2be83414b - updated assembler to support new shift implementation
- updated emulator to support new shift implementation
- updated emulator to rename NoReg to Null as in the common lib
2026-02-09 00:05:45 +00:00
zxq5 f7ed764e96 renamed NoReg to Null in common 2026-02-09 00:04:19 +00:00
zxq5 328741eb51 updated compiler with support for more operators.
(only the unary operators from this are implemented for now)
2026-02-08 20:03:31 +00:00
zxq5 9f35fc9415 block allocator implementation and example 2026-02-08 12:36:49 +00:00
zxq5 828f5bfb2d fixed pointers and stuff. 2026-02-08 11:45:26 +00:00
zxq5 6699333b2c - C frontend broken for now
- If statements work properly now (hopefully)
- still issues with while loops pushing vars to the stack. need scoping
  implemented to fix this!

- refactored registers.rs and fixed faulty logic.
- made register allocation optimisations
2026-02-08 00:14:18 +00:00
zxq5 e9329eca95 update roadmap and ISA spec 2026-02-07 18:21:37 +00:00
zxq5 250b780e14 fix broken build system commit 2026-02-07 18:20:59 +00:00
zxq5 bbcef7178f updated assembler to write to binary files correctly 🤦 2026-02-06 15:15:10 +00:00
zxq5 1fcfb3120b started working on build system 2026-02-05 03:12:44 +00:00
zxq5 e69514e46e modified editor to include syntax for .dsc files 2026-02-05 01:26:37 +00:00
zxq5 b8abbfd02f added a brainf&&k module to the compiler (specialised module so no
frontend/backend distinction or use of standard model)
2026-02-05 01:11:38 +00:00
zxq5 c2bf9f6667 added a (very incomplete) C frontend for DSAC 2026-02-05 01:10:47 +00:00
zxq5 2f91c4127c reorganised code examples 2026-02-05 01:10:31 +00:00
zxq5 89762b54e3 updated docs 2026-02-05 01:09:38 +00:00
zxq5 a35cfbe864 updated compiler to support multiple frontends and backends 2026-02-05 01:09:14 +00:00
zxq5 8d130a870c deleted the c compiler 2026-02-05 01:07:59 +00:00
zxq5 a1099249e9 updated roadmap 2026-02-04 01:59:50 +00:00
zxq5 cb65a928c8 fixed bug where stack inspector shows incorrect addresses 2026-02-04 01:59:43 +00:00
zxq5 fa8aa1cd29 integrated compiler in DSA editor 2026-02-04 01:58:55 +00:00
zxq5 7780f5804f deleted old files and modified some dsa source files 2026-02-04 01:58:37 +00:00
zxq5 889ee8ef71 wrote dsa/dsc code examples including an allocator 2026-02-04 01:58:03 +00:00
zxq5 dd20401ad6 added basic logging to common
TODO: improve logging
2026-02-04 01:57:40 +00:00
zxq5 f4933b55fb forgot to commit this 2026-02-04 01:57:18 +00:00
zxq5 14a04a524c added support for DSA libraries to compiler and made some optimisations.
provided an API for the editor to use.
2026-02-04 01:56:58 +00:00
zxq5 f25db6c8fd updated assembler logging 2026-02-04 01:56:15 +00:00
zxq5 48a74bfde2 updated dsc example to reflect current feature set. 2026-02-03 15:38:40 +00:00
zxq5 7973b2afca - refactored lexer
- updated lexer to allow hex and binary integer literals
- updated parser with support for writing to pointers
- updated code generation to support writing to pointers
- fixed a bug with codegen where args are loaded from incorrect offsets
  due to saving registers prior to calling.
2026-02-03 15:37:38 +00:00
zxq5 ce2eda72a0 updated roadmap with progress 2026-02-03 15:34:35 +00:00
zxq5 3afeafc9d4 - compiler works for basic maths expressions and functions
- basic pointers and reading values from pointers works
- writing to pointers not yet implemented (looks painful so a problem
  for tomorrow)
- updated print library. the compiler has this hardcoded in all programs
  for now
2026-02-03 02:11:30 +00:00
zxq5 5573c5a609 minor code changes for codegen 2026-02-02 11:15:45 +00:00
zxq5 8f7163c459 added some documentation and started on compiler for custom language (not C) based on previous prototypes. pretty broken state rn. 2026-02-01 22:16:09 +00:00
zxq5 52ef7872f0 compiler working for some mathematical expressions, function calls and
simple conditionals
2026-01-31 13:28:42 +00:00
zxq5 e31deb594f fixed a bug with the multiply function in core.dsa and added a print_num
function to print.dsa for decimal numbers
2026-01-31 13:28:11 +00:00
zxq5 63c9d858b4 added a to-do list and bacon.toml for developing the compiler 2026-01-31 13:27:31 +00:00
zxq5 782c842a42 updated gitignore 2026-01-29 19:33:30 +00:00
zxq5 259746558f codegen progress 2026-01-29 19:29:48 +00:00
zxq5 b9f98bff7b started on codegen, scaffolding basically done 2025-11-15 02:58:36 +00:00
zxq5 091dabfbf3 Merge remote-tracking branch 'refs/remotes/origin/compiler' into compiler 2025-11-14 23:37:57 +00:00
zxq5 fd5b305576 started work on c compiler 2025-11-14 23:36:51 +00:00
zxq5 b33fdbfeec rust macros make me want to unalive. 2025-07-01 01:08:37 +01:00
zxq5 2582ad10fa started work on compiler 2025-06-30 20:44:39 +01:00
zxq5 67ebf48d6f removed old log file 2025-06-29 02:08:06 +01:00
zxq5 98668c681e more optimisations test program ~54MIPS -> ~110MIPS 2025-06-29 02:04:14 +01:00
zxq5 05a25447b2 minor optimisation to reduce unnecessary allocations 2025-06-28 03:43:20 +01:00
zxq5 56d2abe17f - optimised main emulator loop, allowing updates only once every roughly 32,000 instructions.
- optimised memory access patterns, removing unecessary mutability and accesses.
- replaced the standard HashMap with an implementation that uses a faster hashing algorithm.

results:

before:
    - our benchmark program with ~4m instructions would take around for their data to make it to the UI, and a bit over 200ms to actually run

after:
    - our benchmark program with ~4m instructions can run in around 75ms, and the UI receives the update almost instantly.

conclusion:
- emulator performance should be around 2-3x faster than before.
2025-06-28 03:21:46 +01:00
zxq5 eaaefd1b07 added rule to .gitignore 2025-06-27 18:31:52 +01:00
zxq5 5302ad3876 removed junk files 2025-06-27 18:30:53 +01:00
zxq5 2280f1e5d9 updated vscode settings 2025-06-27 18:30:26 +01:00
zxq5 ae92510fb8 dsa lib bugfixes 2025-06-26 20:53:51 +01:00
zxq5 7c63340888 minor changes to assembler 2025-06-26 20:53:22 +01:00
zxq5 e9f04824ea updates to dsa libs 2025-06-26 00:51:20 +01:00
zxq5 620584488b fixed unit tests & misc changes to workspace config 2025-06-26 00:50:58 +01:00
zxq5 1101331f70 fixed a couple of emulator bugs, including fixing shift instructions. finished implementing lib/io/print/print_hex_byte and print_hex_word 2025-06-25 16:31:42 +01:00
zxq5 c171b0db89 worked on print.dsa and maths/core.dsa 2025-06-25 00:40:31 +01:00
zxq5 82b99c127c finished initial interrupts implementation 2025-06-25 00:13:55 +01:00
zxq5 2a6991fe4a idk, i refactored some stuff ig 2025-06-24 19:34:45 +01:00
zxq5 0fdd28aad1 finished the interpreter 2025-06-24 19:31:55 +01:00
zxq5 f639240b6c progress on debugging bf.dsa 2025-06-24 18:07:33 +01:00
zxq5 d2c1492dca added step(n) feature to emulator, allowing for stepping n instructions at a time 2025-06-24 18:07:11 +01:00
zxq5 4ef8bbdf46 updated dependencies 2025-06-24 18:06:29 +01:00
zxq5 76197fac8f finished refactor of emulator - started on loader (needs significant changes before functional in the way that I would like) 2025-06-23 23:45:47 +01:00
zxq5 bc5ddef311 added error handling to emulator 2025-06-23 21:28:38 +01:00
zxq5 ddd0c27893 found a cause of a memory bug in emulator - fix is TODO (#6) - continued working on brainf interpreter. we really need better debugging tools tbh. 2025-06-23 00:31:09 +01:00
zxq5 b8091222a4 working on bf.dsa (brainf##k interpreter) cos fun 2025-06-22 16:14:51 +01:00
zxq5 6ea3a76d74 fixed some bugs with file picker & loading different file types - will start working on brainf##k interpreter tomorrow because a compiler isn't enough. 2025-06-22 05:19:55 +01:00
zxq5 2b777f55c7 Merge remote-tracking branch 'refs/remotes/origin/main' 2025-06-22 03:54:44 +01:00
zxq5 808b51ff5f updated emulator to support importing .dsb binaries 2025-06-22 03:52:11 +01:00
zxq5 7892c44d89 updated print with new functions 2025-06-22 03:51:39 +01:00
zxq5 9c56258c48 assembler changes & brainf##k compiler lmao 2025-06-22 03:51:16 +01:00
zxq5 528ceddade refactor & fixed assembler path handling 2025-06-21 04:05:22 +01:00
zxq5 42c26d4184 added a create-project system to assembler, and fixed a couple of parsing bugs 2025-06-20 03:25:28 +01:00
zxq5 f791b05292 idk what changes i made 2025-06-19 23:30:32 +01:00
zxq5 52e2306fca refactoring assembler 2025-06-19 23:28:53 +01:00
zxq5 5c83b49328 fixed some clippy warns 2025-06-19 18:50:57 +01:00
zxq5 d4e538a2b3 purged .unwrap() 2025-06-19 16:57:43 +01:00
zxq5 d5a690563b fixed some clippy errors 2025-06-19 15:44:42 +01:00
zxq5 c1d72e8d4c Merge remote-tracking branch 'refs/remotes/origin/main' 2025-06-19 15:21:07 +01:00
zxq5 e308362533 idk 2025-06-19 15:18:48 +01:00
zxq5 5784beafbc An idiot admires complexity, a genius admires simplicity, a physicist tries to make it simple, for an idiot anything the more complicated it is the more he will admire it, if you make something so clusterfucked he can't understand it he's gonna think you're a god cause you made it so complicated nobody can understand it. That's how they write journals in Academics, they try to make it so complicated people think you're a genius 2025-06-19 02:58:30 +01:00
zxq5 ccc4421bb1 I should go to sleep frfr. 2025-06-19 02:56:15 +01:00
zxq5 11a107e56d wrote print.dsa 2025-06-19 01:57:47 +01:00
zxq5 6b58a17f03 fixed a lot of bugs with the emulator, instruction set and assembler 2025-06-19 01:57:36 +01:00
zxq5 e281bc2d1d IT WORKS HELL YEAH. 2025-06-18 22:53:01 +01:00
zxq5 1210b19333 asm done with parsing and linking. codegen all that's left 2025-06-18 03:54:39 +01:00
zxq5 6a0b5c617a Merge remote-tracking branch 'refs/remotes/origin/main' 2025-06-17 23:50:52 +01:00