My main interest is in developing programing languages.
I'm the developer of bah-lang.
My main languages are Go, web languages, C and Bah.
Bah compiler written in bah
License: GNU General Public License v3.0
does bah support musl libc? I get this build error:
CC tcc
C compiler: tcc
Parsed. (2138 lines, total time: 16ms, lexer time: 4ms)
[CC-ERROR]
Could not compile.
while compiling this bah code:
#import "iostream.bah"
main(args []cpstring) int {
println("merhaba dünya")
return 0
}
Edit: translated to c and gcc seem to have error compiling it:
/opt/bah/builtin.bah: In function 'print':
/opt/bah/builtin.bah:93:7: warning: passing argument 1 of 'write' makes integer from pointer without a cast [-Wint-conversion]
93 | write(1, s, len(s))
| ^~~~~~~~~
| |
| void *
In file included from /opt/bah/builtin.bah:80:
/usr/include/unistd.h:51:15: note: expected 'int' but argument is of type 'void *'
51 | ssize_t write(int, const void *, size_t);
| ^~~
/opt/bah/gc.bah: In function 'cleanShutDown':
/opt/bah/gc.bah:53:1: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
53 | exit(1)
| ^
/opt/bah/gc.bah:30:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
29 | //The allocated memory cannot be shared by multiple processes. Use the sharedMemory() function instead.
+++ |+#include <stdlib.h>
30 | memoryAlloc(s int) ptr {
/opt/bah/gc.bah:53:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
53 | exit(1)
| ^
/opt/bah/gc.bah:53:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
/opt/bah/gc.bah: In function 'memoryAllocSTR':
/opt/bah/gc.bah:85:20: warning: initialization of 'unsigned int *' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
85 | ln uint32 = r
| ^
/opt/bah/memory.bah: At top level:
/opt/bah/memory.bah:108: warning: "MAP_SHARED" redefined
108 | const MAP_SHARED = 1
|
In file included from /opt/bah/builtin.bah:99:
/usr/include/sys/mman.h:21: note: this is the location of the previous definition
21 | #define MAP_SHARED 0x01
|
/opt/bah/memory.bah:109: warning: "MAP_ANONYMOUS" redefined
109 | const MAP_ANONYMOUS = 32
|
/usr/include/sys/mman.h:27: note: this is the location of the previous definition
27 | #define MAP_ANONYMOUS MAP_ANON
|
/opt/bah/memory.bah: In function 'delete':
/opt/bah/memory.bah:191:21: warning: initialization of 'void *' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
191 | destOffset ptr = elemSize * i
| ^~~~~~~~
/opt/bah/memory.bah:193:17: warning: initialization of 'void *' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
193 | offset ptr = elemSize * i
| ^~~~~~~~
/opt/bah/memory.bah:194:13: warning: initialization of 'char ' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
194 | src char = data + offset
| ^
/opt/bah/memory.bah:195:14: warning: initialization of 'char ' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
195 | dest char = data + destOffset
| ^
/opt/bah/memory.bah: In function 'deleteRange':
/opt/bah/memory.bah:214:15: warning: initialization of 'void *' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
214 | dest ptr = data + elemSize * from
| ^
/opt/bah/memory.bah:215:14: warning: initialization of 'void *' from 'long long int' makes pointer from integer without a cast [-Wint-conversion]
215 | src ptr = dest + size + elemSize
| ^
/opt/bah/memory.bah: In function 'arrToStr':
/opt/bah/memory.bah:225:50: warning: comparison between pointer and integer
225 | if len(arr) > 0 && arr[len(arr)-1] == null {
| ^
/opt/bah/memory.bah:231:20: warning: initialization of 'unsigned int *' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
231 | ln uint32 = str
| ^
/opt/bah/builtin.bah: In function 'buffToStr':
/opt/bah/builtin.bah:111:27: warning: initialization of 'unsigned int ' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
111 | ln uint32 = s
| ^
/opt/bah/builtin.bah: In function 'cStrToBah':
/opt/bah/builtin.bah:133:27: warning: initialization of 'unsigned int ' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
133 | ln uint32 = nstr
| ^
/opt/bah/builtin.bah: In function '__Bah_multiple_concat':
/opt/bah/builtin.bah:141:22: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
141 | lens uint32 = alloca(l * sizeof(uint32)) //stack list of lengths
| ^~~~~~
/opt/bah/builtin.bah:141:22: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
/opt/bah/builtin.bah:161:27: warning: initialization of 'unsigned int ' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
161 | ln uint32 = r
| ^
/opt/bah/builtin.bah: In function '__STR':
/opt/bah/builtin.bah:192:27: warning: initialization of 'unsigned int ' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
192 | ln uint32 = r
| ^
/opt/bah/builtin.bah: In function '__checkString':
/opt/bah/builtin.bah:208:68: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
208 | print("cpstring ("+l+") is null \n")
| ^
/opt/bah/builtin.bah:209:8: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
209 | exit(1)
| ^ ~~
/opt/bah/builtin.bah:100:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
99 | }
+++ |+#include <stdlib.h>
100 |
/opt/bah/thread.bah: In function 'thread__create':
/opt/bah/thread.bah:13:25: warning: implicit declaration of function 'GC_pthread_create'; did you mean 'pthread_create'? [-Wimplicit-function-declaration]
13 | const __thread_create = GC_pthread_create
| ^~~~~~~~~~~~~~~~~
/opt/bah/thread.bah:133:1: note: in expansion of macro '__thread_create'
133 | __thread_create(&this.id, null, this.handle, null)
| ^ ~~~~~~~
/opt/bah/thread.bah: In function 'thread__wait':
/opt/bah/thread.bah:14:23: warning: implicit declaration of function 'GC_pthread_join'; did you mean 'pthread_join'? [-Wimplicit-function-declaration]
14 | const __thread_join = GC_pthread_join
| ^~~~~~~~~~~~~~~
/opt/bah/thread.bah:144:1: note: in expansion of macro '__thread_join'
144 | __thread_join(this.id, null)
| ^ ~~~~~
/opt/bah/builtin.bah: In function 'fastExec':
/opt/bah/builtin.bah:264:34: warning: initialization of 'unsigned int ' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
264 | ln uint32 = response
| ^~~~
/opt/bah/builtin.bah: In function '__BAH_panic':
/opt/bah/builtin.bah:280:62: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
280 | print("panic ("+line+"): "+e+"\n")
| ^
/opt/bah/builtin.bah:297:40: warning: initialization of 'long long int' from 'void ' makes integer from pointer without a cast [-Wint-conversion]
297 | p int = arr[i]
| ^
/opt/bah/builtin.bah: In function '__Bah_segfault_handle':
/opt/bah/builtin.bah:340:62: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
340 | __BAH_panic("Memory error (segfault).\n"+res, "???")
| ^
/opt/bah/builtin.bah: In function '__Bah_init_segfaultHandle':
/opt/bah/builtin.bah:345:24: warning: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types]
345 | signal(noCheck(SIGSEGV), __Bah_segfault_handle)
| ^~~~~~~~~~~~~~~~~~~~~
| |
| void ()(long long int)
In file included from merhaba.c:23:
/usr/include/signal.h:289:20: note: expected 'void ()(int)' but argument is of type 'void ()(long long int)'
289 | void (signal(int, void ()(int)))(int);
| ^~~~~~~~~~~~~
/opt/bah/builtin.bah: In function '__Bah_safe_string':
/opt/bah/builtin.bah:378:62: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
378 | return """+s+"""
| ^
/opt/bah/builtin.bah: In function '__Bah_realocate_arr':
/opt/bah/builtin.bah:400:69: warning: incompatible implicit declaration of built-in function 'alloca' [-Wbuiltin-declaration-mismatch]
400 | n: array append out of bounds violation, index = "+cStrToBah(<char>indexStr)+" and len = "+cStrToBah(<char>lengthStr)+". Can only append index=length.")
| ^~~~~~/opt/bah/map.bah: In function 'mapNode__calc':
/opt/bah/map.bah:41:12: warning: comparison between pointer and integer
41 | if s[i] == null || this.str[i] != s[i] {
| ^~
/opt/bah/map.bah:45:29: warning: comparison between pointer and integer
45 | if i == this.strL && s[i] == null {
| ^~
/opt/bah/builtin.bah: In function 'strBuilder__append':
/opt/bah/builtin.bah:480:20: warning: initialization of 'unsigned int *' from incompatible pointer type 'char ' [-Wincompatible-pointer-types]
480 | ln uint32 = this.buff
| ^~~~
/opt/bah/iostream.bah: In function 'stdinput':
/opt/bah/iostream.bah:21:20: warning: passing argument 1 of 'read' makes integer from pointer without a cast [-Wint-conversion]
21 | nDataLength = read(0,buff,1024)
| ^~~~~~~~~
| |
| void *
/usr/include/unistd.h:50:14: note: expected 'int' but argument is of type 'void *'
50 | ssize_t read(int, void *, size_t);
| ^~~
/opt/bah/iostream.bah:36:20: warning: passing argument 1 of 'read' makes integer from pointer without a cast [-Wint-conversion]
36 | nDataLength = read(0,buff,1024)
| ^~~~~~~~~
| |
| void *
/usr/include/unistd.h:50:14: note: expected 'int' but argument is of type 'void *'
50 | ssize_t read(int, void *, size_t);
| ^~~
/opt/bah/iostream.bah: In function 'println':
/opt/bah/iostream.bah:61:333: warning: passing argument 1 of 'write' makes integer from pointer without a cast [-Wint-conversion]
61 | write(1, s+"\n", len(s)+1)
| ^
| |
| void *
/usr/include/unistd.h:51:15: note: expected 'int' but argument is of type 'void *'
51 | ssize_t write(int, const void *, size_t);
| ^~~
/ev/çizeylemcil/bah/merhaba.bah: In function '__BAH_init':
/ev/çizeylemcil/bah/merhaba.bah:381:29: warning: assignment discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionmain': merhaba.c:(.text+0x10): undefined reference to
GC_init'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionmemoryAlloc': merhaba.c:(.text+0x181): undefined reference to
GC_malloc'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functiondestroy': merhaba.c:(.text+0x19b): undefined reference to
GC_free'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionmemoryRealloc': merhaba.c:(.text+0x1e0): undefined reference to
GC_realloc'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionmemoryOnEnd': merhaba.c:(.text+0x220): undefined reference to
GC_register_finalizer_ignore_self'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionmemoryAllocSTR': merhaba.c:(.text+0x2f4): undefined reference to
GC_malloc'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionthread__create': merhaba.c:(.text+0x10c3): undefined reference to
GC_pthread_create'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionthread__createWithArg': merhaba.c:(.text+0x10f8): undefined reference to
GC_pthread_create'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in functionthread__wait': merhaba.c:(.text+0x1120): undefined reference to
GC_pthread_join'
/an/duyum/etki/ld: /tmp/ccEjklla.o: in function__BAH_panic': merhaba.c:(.text+0x1c08): undefined reference to
backtrace'
collect2: error: ld returned 1 exit status
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.