coollang-2020-fs
selfie
Our great sponsors
coollang-2020-fs | selfie | |
---|---|---|
5 | 21 | |
37 | 2,337 | |
- | 0.9% | |
9.2 | 9.6 | |
2 months ago | 3 days ago | |
F# | Jupyter Notebook | |
MIT License | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
coollang-2020-fs
-
Course using F#: Write your own tiny programming system(s)
Looks interesting.
Once I saw it's a Czech university course using F#, I knew Tomáš Petříček would be the lecturer :)
A couple years back, I wrote a compiler of tiny-ish scala subset in F# (the code is imperative, though)[1]
-
Compiler Class
You might find [CS 6120: Advanced Compilers: The Self-Guided Online Course][1] interesting. I'm slowly working through it, but basically its focus is intermediate representations, optimizations, etc. A link to the course was on the first page of HN some time ago.
Also -- and you knew it was coming -- I've written a [toy-compiler of a Scala subset][2] myself :)
I'm new to F# and writing compilers, so I'm sure the code is full of rookie mistakes. Still, it works and does generate assembly and executables for Linux and Windows.
[1]: https://www.cs.cornell.edu/courses/cs6120/2020fa/self-guided...
selfie
- A tiny hand crafted CPU emulator, C compiler, and Operating System
-
Project Oberon the Design of an Operating System, a Compiler, and a Computer Pdf
this sort of exists at https://github.com/cksystemsteaching/selfie
> Selfie is a self-contained 64-bit, 12KLOC C implementation of: (...) a tiny (...) subset of C called C Star (C) (...) to a tiny (...) subset of RISC-V called RISC-U[;] a[n] (...) emulator (...) that executes RISC-U code[;] (...) a (...) hypervisor (...) that provides RISC-U virtual machines*
so they have an instruction set architecture, a compiler, and an operating system, though it's much simpler than xv6. because the instruction set is a subset of risc-v you can run its code on actual risc-v hardware (or qemu-system-riscv), but presumably you could also design risc-u hardware in verilog that was simpler than a full implementation of rv64i with whatever extensions the hypervisor needs
- Best book on writing an optimizing compiler (inlining, types, abstract interpretation)?
- Selfie: An educational platform for teaching systems engineering
-
Selfie – A tiny RISC-V C compiler, emulator and hypervisor
From the project’s README [1]:
> Selfie is implemented in a single (!) file and kept minimal for simplicity. There is also a simple in-memory linker, a RISC-U disassembler, a garbage collector, L1 instruction and data caches, a profiler, and a debugger with replay as well as minimal operating system support in the form of RISC-V system calls built into the emulator and hypervisor. The garbage collector is conservative and even self-collecting. It may operate as library in the same address space as the mutator and/or as part of the emulator in the address space of the kernel.
I was a bit skeptical, but I’m very impressed right now [2] . . .
[1]: https://github.com/cksystemsteaching/selfie/tree/5de675a0f08...
[2]: https://github.com/cksystemsteaching/selfie/blob/5de675a0f08...
I think it's because their subset of C [1], which they call C Star (C*), doesn't support the `sizeof` operator. Since Selfie is supposed to be able to compile itself, it seems they've restricted the used grammar to the subset supported by C*.
[1]: https://github.com/cksystemsteaching/selfie/blob/50b5fec8378...
-
What's everyone working on this week (46/2021)?
It's also more than simply a compiler, there are emulator and hypervisor built in etc. Very interesting, check it out on GitHub.
-
Compiler Class
Maybe this is interesting to you as well? https://github.com/cksystemsteaching/selfie
-
ECTS Chaos an österreichischen Universitäten
Bei uns war es forcierte Gruppenarbeit an einem damals noch experimentellen selfie. Es ging darum eine Basisversion zu erweitern. Leider war damals der Startcompiler alles andere als Wartbar, wodurch also die Studenten gleichzeitig mit harter Gruppenarbeit und bisher nicht gewohntem Legacy Code konfrontiert waren.
What are some alternatives?
oscam-patched - Open Source Cam Emulator
shecc - A self-hosting and educational C optimizing compiler
scamp-cpu - A homebrew 16-bit CPU with a homebrew Unix-like-ish operating system.
perseus - A state-driven web development framework for Rust with full support for server-side rendering and static generation.
jet - A Fast C and Python like Programming Language that puts the Developer first. WIP
proc - Procedural Intel x86_64 compiler from scratch, inspired by Fortran, Pascal and Assembly.
nelua-lang - Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.
Fable: F# |> BABEL - F# to JavaScript, TypeScript, Python, Rust and Dart Compiler
Teaching - :mortar_board: Materials for my lectures including programming langauge design, software engineering and human-computer interaction.
the_ray_tracer_challenge_in_rust - Repository to follow my development of "The Raytracer Challenge" book by Jamis Buck in the language Rust