Giter Site home page Giter Site logo

cupcake-compiler's People

Contributors

julgodis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cupcake-compiler's Issues

Cannot save to "output.cpp"

I know this is kind of old, but I really want to play around with this fan creation of the compiler.
When ever calling the compiler with the source file as cupcake main.jai or whatever, there is always an error that reads:

Cupcake (v0.1-alpha)                                                                                                                                                     
Error: Module/File not found (path: .\modules\)                                                                                                                          
There were errors, exiting!

Basically it can never find the file or modules when called so it cannot compile. It also for some reason does not respond to command line arguments like -r, -v, -m, etc. This is on 64 bit Windows 10 and I know it says the executable is win32, but Python runs fine as a win32 executable on 64 bit Windows 10, so why shouldn't this? I heard rumours of there being a new version back in 2018, but that was never put out and we can't even fix this ourselves from showing the source. I would like to know why this behaviour is happening.

UPDATE: This behaviour has been fixed, the lowest post is what relates to the title of the issue now

Errors from compiling the C++ output file

This was compiled on Windows 10 64-bit with MinGW (g++). At first, there were a bunch in the big array rodata[] about the requirement of narrowing conversions from int to char:

Untitled

And then a lot of crossing initialization errors:

Untitled2

I also at the very top, I got a preprocessor error that stdio.h could not be found. I know that's the standard input-output for C, but C++ has iostream and none of the standard headers for it end with .h anymore if I remember correctly.

Take this as you will since I don't know how this can be completely fixed if there are so many, but I mean this is not a necessity per se and I don't need/want this fixed ASAP, however it would be good if the compile succeeded later on in the future, or if the actual compiler comes out.

Cant link dll

I have no idea why, but i cant link my test dll file
File mylib.c:

#include <stdio.h>
#include <inttypes.h>

typedef  int32_t s32;

#define DLLEXPORT __declspec(dllexport)

DLLEXPORT void my_hello(void) {
	printf("hi from my_hello!\n");
}

DLLEXPORT s32 my_sum(s32 a, s32 b) {
	return a + b;
}

File main.jai:

#import "modules/Print.jai"

#foreign_library "mylib"
my_hello  :: #no_context () -> Void #foreign;
my_sum    :: #no_context (a: s32, b: s32) -> s32 #foreign;

main :: () {
	my_hello();
	print("my_sum test: %", my_sum(24, 4));
}

#run main()

Build process:

> clang -shared mylib.c -o mylib.dll
#or
> tcc -shared mylib.c

> cupcake main.jai
Cupcake (v0.1-alpha)
* External: 'my_hello' 6 (0)
* External: 'my_sum' 6 (0)
* Function: 'main' 2 (0)
*      Run: 3
-------------------------------------------
Workspace 'program' (2 errors, 2 reports)
.\main.jai:4,1: Error: Unknown foreign procedure 'my_hello' (my_hello)


    >
    > #foreign_library "mylib"
    > my_hello  :: #no_context () -> Void #foreign;
    > ^

.\main.jai:5,1: Error: Unknown foreign procedure 'my_sum' (my_sum)


    > #foreign_library "mylib"
    > my_hello  :: #no_context () -> Void #foreign;
    > my_sum    :: #no_context (a: s32, b: s32) -> s32 #foreign;
    > ^


There were errors, exiting!

"Internal Compiler Error" when returning from void function

This code:

#import "modules/Print.jai"

test :: () {
	print("Hello");
	return;
	print(" world");
}

main :: () {
	test();
}

#run main()

run with cupcake mytest.jai produces this error:

Cupcake (v0.1-alpha)
Assertion failed at ..\src\ssa\ssa_realloc.cpp:406 inside coloring_spill_find
Condition: false
Internal Compiler Error : Invalid Code Path

Looks like return; crushes interpreter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.