mustafaquraish / cup Goto Github PK
View Code? Open in Web Editor NEWsimple, C-like compiled programming language
License: MIT License
simple, C-like compiled programming language
License: MIT License
Thanks for your great work.
I would like to get the source code which produce the bootstrap assembly code.
Maybe you write the bootstrap code in C, Rust ..
Thanks.
Build Issue
Environment
macOS BigSur version 11.6
Description
I was trying to follow the installation guide.
I can't seem to build it on macOS BigSur.
What I did
First of all, I googled this error.
$ ./meta/bootstrap.sh
[+] Compiling the bootstrap compiler...
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
https://stackoverflow.com/a/65570573
In accordance with this, fixed.
(meta/bootstrap.sh)
Darwin)
cp bootstrap/macos.yasm bootstrap/cupcc.yasm
yasm -f macho64 -o bootstrap/cupcc.o bootstrap/cupcc.yasm
ld -o bootstrap/cupcc bootstrap/cupcc.o -macosx_version_min 11.6 -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem
;;
Then, I cannnot fix the next error.
$ ./meta/bootstrap.sh
[+] Compiling the bootstrap compiler...
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in func_die from bootstrap/cupcc.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
[+] Creating build/cupcc with bootstrap compiler...
[+] /usr/local/bin/yasm -fmacho64 -o build/cupcc.o build/cupcc.yasm
[+] /usr/bin/ld -o build/cupcc build/cupcc.o -lSystem
ld: library not found for -lSystem
std/common.cup:350:14: Child exited with non-zero status: (1)
Maybe instead of using defer
statements we can use with
blocks:
struct A{
a: i32,
}
fn new_a(): A*{
...
}
method A::close(){
...
}
fn main(){
with let foo: A* = new_a(){
...
}
}
Which essentially means:
struct A{
a: i32,
}
fn new_a(): A*{
...
}
method A::close(){
...
}
fn main(){
let foo: A* = new_a();
...
foo::close();
}
Manually import it is getting tedious, especially since you need it for almost anything useful.
It is a very needed feature.
The last commit was 2 years ago.
First of all, i wanna thank you for this repo :)
This is not a issue, but a question, since obviously you have more experience than me, and im just trying to find something....
I was searching for more repos like this, a kind of "programming language", but i literally found nothing, if you had to know some code that could help i will be thankful. !
I basically would love to have it in c/cpp, but anything can work !
Thanks for your time, and hope you reply soon :)
I tried to compile the following program:
struct A{
a: int;
b: int;
c: int;
}
fn a(): A{
let a_: A;
a_.a = 1;
a_.b = 2;
a_.c = 2;
return a_;
}
fn main(){
}
Compiler tells me:
A
compiler/codegen.cup:66:9: Unsupported type size
Those are very needed too.
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.