Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wax compiler in wax - working implementation #25

Open
jacoblister opened this issue Dec 2, 2021 · 0 comments
Open

Wax compiler in wax - working implementation #25

jacoblister opened this issue Dec 2, 2021 · 0 comments

Comments

@jacoblister
Copy link

jacoblister commented Dec 2, 2021

@LingDong- I've made some surprisingly rapid progress on a self hosted compiler implementation, please see:

https://github.com/jacoblister/wax/blob/compiler/examples/compiler.wax

To use, copy the wax code into the Playground and run - this will output javascript , copy and paste into a browser console window, and get - working example programs!

The following programs are working so far:

  • hello world
  • fibonacci sequence
  • n queens problem
  • hilbert curve
  • turing machine example

just uncomment to example to run in the compiler 'main' function to see the others.

I've only been worked on this for about a week in my spare time/weekends, and already have this much working, so I think the minimal wax language might really be on to something. Looking at what it can do so far, I don't think I'll be too far away from having a self hosted compiler working pretty soon, and all in < 1000 lines of code, with embedded examples!

I have also made a merge request for a Brainfu*k implementation as well - getting that working so easily that got me motivated to try to do a compiler:
28ae5eb

Could you please have a look at that and perhaps merge it into the examples if that's ok?

I'll be having a look at the C language target as well after I get all the basic functionality covered. I would be quite interested in collaborating with you as I make more progress. I can do a longer brain dump about thoughts on approaches if you'd like.

Thanks Kindly,

Jacob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant