4 ms·
Hi, I'm the author and I would be interested in hearing feedback on what you'd like to see next? Directions I can go in: - Fully client side C compiler and I
by robertelder 11y ago
Hi, I'm the author and I would be interested in hearing feedback on what you'd like to see next?
Directions I can go in:
- Fully client side C compiler and IDE
- Full access to parse tree, static analysis with rich html annotations for errors
- For example, if a function call has arguments that don't match the prototype, show a detailed graphic demonstrating that the arguments don't fit into the function
- Write a proper shell for the kernel (right now it responds to single letter commands 'q' 's' 'p'...)
- CPU Emulators for more languages
- Make the compiler produce faster code (it is currently anti-optimized for code simplicity)
- Implement currently unsupported C features (float, double, union, goto, K&R C style functions, ...)
- Implement more of the standard library
- Work toward having better static analysis than GCC or CLANG (but only for C89)
- Write blog posts (about what?)
- Work toward compiling the Linux Kernel
- Create learning tools to help visualize the OS and program stack as the program executes (In addition to showing stack values, provide type annotations via background colours/graphics eg. (0x10000 <= unsigned int))
- Static analysis for MISRA C (at least the rules that aren't equivalent to the halting problem)
- Different CPU word sizes
- Advanced in browser profiling
- A visual tool/animation that shows you every single step of how the C preprocessor works (for complicated cases like recursive variadic macro functions)
- Thousands of other ideas...
- tlarkworthy 11y agoAwesome project! The simple CPU target for a complex language excites me. I am looking for a more interesting target for this: https://github.com/tomlarkworthy/firefrack https://github.com/tomlarkworthy/firefrack So my vote would be on getting as much 3rd party stuff compiling as possible with the architecture you have. Linux would be amazing. This guy did some cool work on compiling linux for 8 bit micros. Might be inspiring if you have not seen it: http://dmitry.gr/index.php?proj=07.+Linux+on+8bit&r=05.Projects http://dmitry.gr/index.php?proj=07.+Linux+on+8bit&r=05.Proje...
- robertelder 11y agoYeah, I actually read that guys blog post to see how practical it would be to run something like linux on a smaller word sized CPU. Since the CPU emulation code is only 325 lines of C, it wouldn't be a lot of work to port it to emulate the 32 bit instructions on a very small word size.
- tptacek 11y ago512 registers! Did you do this so you could punt on register allocation?
- robertelder 11y agoIn the previous version of the spec, I had a large number of bits that were unused, but once I thought about it I realized that any bits that go unused tautologically guarantee less than optimal performance. I played with the instructions a bit, and it worked out well to allow addressing of registers with 9 bits. Right now, the compiler mainly works as a stack machine and doesn't use more than 10 registers at a time (usually just one or two). In the future, I think it would make sense to make the number of registers big enough that it would fit inside the lowest level CPU cache, since this CPU is mainly designed to be emulated. Storing temporary data in registers instead of the stack has the advantage of not needing to push and pop all the time.
- tptacek 11y agoI like the idea of visualizing the parse tree, and another fun place to go would be to do a real IR, bring things into SSA form, show phi function placement, and then do register allocation and optimization.
- rayiner 11y agoI have in the past used xdot files to good effect for visualizing phi function placement and interference graphs. What would be great is a way to make the result interactive (e.g. drill down from basic blocks to instructions, selectively get more or less detail on voluminous data like live ranges). Graphviz unfortunately isn't suitable for that.
- dman 11y agoWould you pay for such a tool?
- 11y ago
- ticviking 11y agoI haven't been able to play with this much yet, but it feels an accessible way to play with low level computer ideas. I feel like this could hit a sweet spot between "toy computer that doesn't do anything fun", and "fully modern computer that is too complicated to understand the entire stack on" for code camps and teenagers. I'm definitely following with interest, and will be seeing if I can make some fun activities using this for our upcoming code camp. I would love to know what contributions you would like from the community.
- robertelder 11y agoI'm glad to hear that because, although I would like to take this project somewhere where it would be used for real engineering applications, I think it would only currently have practical applications in teaching. I would love to work on this project full time, but unless I could derive income from a project like this, is just isn't practical. In terms of contributions from the community, I think the two most valuable things any of you could do at this point would be: 1) Tell other people and share + like etc on Facebook Twitter etc. 2) Reach out to me and provide feedback on why this project interests you, and where you think it could go. You can reach me at 'robert at robertelder.org'
- tinco 11y agoIt all looks great. Could you perhaps license your test suite and maybe your libc stuff MIT? I understand if you want to keep your kernel and compiler under some license that still allows for commercial control (like GPL or some dual license scheme) but there's not much commercial value in the test suite and I think it could be of value to others :)
- robertelder 11y agoWhat do you think about Apache 2.0?
- tinco 11y agoI myself like to keep the world neatly divided in GPL and MIT, but Apache 2.0 looks permissive enough :) What makes you prefer Apache 2.0 over MIT?
- robertelder 11y agoThe Apache license explicitly mentions patents. I think that for a project to be successful it should be painless for big companies to use it. Lawyers and IP people at large companies generally have a much more serious tone than programmers when it comes to considering which licenses they can include in their stack.
- zvrba 11y agoRelated to your project: At my university, we learned basics of assembler programming in an IDE made by one of the professors. It was written in Xaw/Athena widget se. Now I see somebody has ported it to javascript: http://ivanzuzak.info/FRISCjs/webapp/ http://ivanzuzak.info/FRISCjs/webapp/