bencochran / kaleidoscope Goto Github PK
View Code? Open in Web Editor NEWSimple programming language written in Swift and compiled with LLVM
Simple programming language written in Swift and compiled with LLVM
For example (in C):
double putchard(double c) {
return (double)putchar((double)c);
}
Just a few utilities that aren’t expressible in the native Kaleidoscope code.
Right now, we have no way to generate a value main
definition.
I think I want to solve this by requiring a def main()
with zero parameters. Then during codegen we can special-case main
and generate it to return an int (maybe casting the function body’s result?). That way we can actually execute the resulting code.
As I work (#5) on adding a putchard
(that just casts to int and calls putchar
) and printd
(that calls to printf("%f", value)
), it would be nice to be able to express these natively as some sort of extended Expression
(instead of writing them each by hand as I am now).
I don’t want to add types to the Kaleidoscope language itself, just augment the parsed expressions with types and add the ability to construct other-typed expressions in code.
Depends on #7
I’m… not exactly sure how to unit test code generation. Just rely on LLVM doing the right thing and cross my fingers?
Should explain how to get LLVM.swift
building. And how to run the output.
Depends on bencochran/KaleidoscopeLang#9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.