mauricegit / compiler Goto Github PK
View Code? Open in Web Editor NEWCompiler for a small language into x86-64 Assembly
Compiler for a small language into x86-64 Assembly
GoodJob,Is it run on Linux? How to run on windows?
Error should be emitted but isn't:
fun test () int {
for ;; {
break
return 0
}
}
Error emitted but shouldn't be:
fun test (x int) int {
if x == 0 { return 0 } else { }
if x == 0 { return 0 } else { return 0 }
}
First of all, really cool project! I'd love to try it out, but I can't seem to get it to work. So I did
go build
brew install yasm
./compiler test.lang
I've taken a look a test.lang
, and I assume it's the example source file. Then I get the following error:
ld: warning: No version-min specified on command line
ld: warning: -arch not specified
ld: warning: -macosx_version_min not specified, assuming 10.11
ld: warning: ignoring file /var/folders/5p/9qqn9bds0kxf85ctpy0s12bm0000gn/T/061022517, file was built for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /var/folders/5p/9qqn9bds0kxf85ctpy0s12bm0000gn/T/061022517
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for inferred architecture x86_64
Error while linking object file - exit status 1
Maybe I'm supposed to be linking something, like in C it would be, e.g. gcc -lcurl ...
, but I'm not sure. Thanks for the help!
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.