Code Monkey home page Code Monkey logo

conehome's People

Contributors

jondgoodwin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

conehome's Issues

Does not compile

Seems to be a Cone issue around usage u32 not being the same type as imm glSTATIC_DRAW = 0x88E4 among others.

pc@localhost:~/test> ./conec --version
Cone Compiler 0.1.0
pc@localhost:~/test> ./conec main.cone --wasm
Error 1013: Expression's type does not match declared parameter
 --> 		pgm = glMakeShader(&vsSrc, &vsSrc, &fsSrc, &fsSrc)
     		                            ^--- shader.cone:21:31
Error 1013: Expression's type does not match declared parameter
 --> 		pgm = glMakeShader(&vsSrc, &vsSrc, &fsSrc, &fsSrc)
     		                                            ^--- shader.cone:21:47
Error 1013: Expression's type does not match declared parameter
 --> 		posAttr = glGetAttrib(pgm, vpos, vpos)
     		                                 ^--- shader.cone:23:36
Error 1013: Expression's type does not match declared parameter
 --> 		colorAttr = glGetAttrib(pgm, vcol, vcol)
     		                                   ^--- shader.cone:25:38
Error 1013: Expression's type does not match declared parameter
 --> 		pmatUnif = glGetUniformLocation(pgm, uPMat, uPMat)
     		                                            ^--- shader.cone:27:47
Error 1013: Expression's type does not match declared parameter
 --> 		mvmatUnif = glGetUniformLocation(pgm, uMVMat, uMVMat)
     		                                              ^--- shader.cone:29:49
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glARRAY_BUFFER, uid)
     		             ^--- main.cone:19:16
Error 1013: Initialization value's type does not match variable's declared type
 --> 		imm arrsize usize = array
     		                    ^--- main.cone:21:23
Error 1025: No method named * matches the call's arguments.
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                   ^--- main.cone:22:38
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		             ^--- main.cone:22:16
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                   ^--- main.cone:22:38
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                             ^--- main.cone:22:48
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glARRAY_BUFFER, uid)
     		             ^--- main.cone:25:16
Error 1013: Expression's type does not match declared parameter
 --> 		glVertexAttribPointer(attrId, itemsize, glFLOAT, false, 0, 0)
     		                                        ^--- main.cone:26:43
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glELEMENT_ARRAY_BUFFER, uid)
     		             ^--- main.cone:35:16
Error 1013: Initialization value's type does not match variable's declared type
 --> 		imm arrsize usize = array
     		                    ^--- main.cone:37:23
Error 1025: No method named * matches the call's arguments.
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                           ^--- main.cone:38:46
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		             ^--- main.cone:38:16
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                           ^--- main.cone:38:46
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                                     ^--- main.cone:38:56
Error 1013: Expression's type does not match declared parameter
 --> 	glClear(glCOLOR_BUFFER_BIT | glDEPTH_BUFFER_BIT)
     	                           ^--- main.cone:177:29
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawArrays(glTRIANGLES, 0, 12)
     	             ^--- main.cone:185:15
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawElements(glTRIANGLES, 36, glUNSIGNED_SHORT, 0)
     	               ^--- main.cone:191:17
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawElements(glTRIANGLES, 36, glUNSIGNED_SHORT, 0)
     	                                ^--- main.cone:191:34
Unsuccessful compile: 24 errors, 0 warnings
pc@localhost:~/test> LD_LIBRARY_PATH=. ./conec main.cone 
Error 1013: Expression's type does not match declared parameter
 --> 		pgm = glMakeShader(&vsSrc, &vsSrc, &fsSrc, &fsSrc)
     		                            ^--- shader.cone:21:31
Error 1013: Expression's type does not match declared parameter
 --> 		pgm = glMakeShader(&vsSrc, &vsSrc, &fsSrc, &fsSrc)
     		                                            ^--- shader.cone:21:47
Error 1013: Expression's type does not match declared parameter
 --> 		posAttr = glGetAttrib(pgm, vpos, vpos)
     		                                 ^--- shader.cone:23:36
Error 1013: Expression's type does not match declared parameter
 --> 		colorAttr = glGetAttrib(pgm, vcol, vcol)
     		                                   ^--- shader.cone:25:38
Error 1013: Expression's type does not match declared parameter
 --> 		pmatUnif = glGetUniformLocation(pgm, uPMat, uPMat)
     		                                            ^--- shader.cone:27:47
Error 1013: Expression's type does not match declared parameter
 --> 		mvmatUnif = glGetUniformLocation(pgm, uMVMat, uMVMat)
     		                                              ^--- shader.cone:29:49
Error 1013: Expression's type does not match lval's type
 --> 		itemsize = itemsz
     		           ^--- main.cone:17:14
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glARRAY_BUFFER, uid)
     		             ^--- main.cone:19:16
Error 1013: Initialization value's type does not match variable's declared type
 --> 		imm arrsize usize = array
     		                    ^--- main.cone:21:23
Error 1025: No method named * matches the call's arguments.
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                   ^--- main.cone:22:38
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		             ^--- main.cone:22:16
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                   ^--- main.cone:22:38
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glARRAY_BUFFER, arr, 4*arrsize, glSTATIC_DRAW)
     		                                             ^--- main.cone:22:48
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glARRAY_BUFFER, uid)
     		             ^--- main.cone:25:16
Error 1013: Expression's type does not match declared parameter
 --> 		glVertexAttribPointer(attrId, itemsize, glFLOAT, false, 0, 0)
     		                                        ^--- main.cone:26:43
Error 1013: Expression's type does not match lval's type
 --> 		itemsize = itemsz
     		           ^--- main.cone:33:14
Error 1013: Expression's type does not match declared parameter
 --> 		glBindBuffer(glELEMENT_ARRAY_BUFFER, uid)
     		             ^--- main.cone:35:16
Error 1013: Initialization value's type does not match variable's declared type
 --> 		imm arrsize usize = array
     		                    ^--- main.cone:37:23
Error 1025: No method named * matches the call's arguments.
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                           ^--- main.cone:38:46
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		             ^--- main.cone:38:16
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                           ^--- main.cone:38:46
Error 1013: Expression's type does not match declared parameter
 --> 		glBufferData(glELEMENT_ARRAY_BUFFER, arr, 2*arrsize, glSTATIC_DRAW)
     		                                                     ^--- main.cone:38:56
Error 1013: Expression's type does not match declared parameter
 --> 	glClear(glCOLOR_BUFFER_BIT | glDEPTH_BUFFER_BIT)
     	                           ^--- main.cone:177:29
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawArrays(glTRIANGLES, 0, 12)
     	             ^--- main.cone:185:15
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawElements(glTRIANGLES, 36, glUNSIGNED_SHORT, 0)
     	               ^--- main.cone:191:17
Error 1013: Expression's type does not match declared parameter
 --> 	glDrawElements(glTRIANGLES, 36, glUNSIGNED_SHORT, 0)
     	                                ^--- main.cone:191:34
Unsuccessful compile: 26 errors, 0 warnings

Cannot compile hello world

Hi.
I tried to compile a hello world example:

// Hello world!
extern fn print(str *u8)

fn main()
  print("Hello world!")

with congo and it fails with the following error:

Compile finished in 0.00372612 sec (84 kb). 0 warnings detected
/usr/sbin/ld: release/main.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/sbin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status

Trying manually with gcc gives me the same result.

I'm on ArchLinux.
Thanks for your help.

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.