Page 1 of 1

small, highly portable, garbage collected, compiled languge

Posted: Tue Sep 25, 2012 11:09 pm
by ishkabible
So I was looking at writing applications for my OS(like a text editor and perhaps minesweeper) and I was pretty strongly considering using Lua. However, I was wondering if anyone knew of any compiled languages that are as portable(or nearly) as C but are somehow garbage collected and preferably can interface with C easily.

Re: small, highly portable, garbage collected, compiled lang

Posted: Tue Sep 25, 2012 11:29 pm
by NickJohnson
Go seems to fit that description. There are also JIT compilers available for Lua (it's impractical to AOT compile because of the dynamic typing though.)

Re: small, highly portable, garbage collected, compiled lang

Posted: Wed Sep 26, 2012 3:44 am
by Combuster
Well, GCC supports Objective-C, which in turn supports garbage collection. It's AOT compiled, and being a superset of C interfacing with C code is completely effortless.

Re: small, highly portable, garbage collected, compiled lang

Posted: Wed Sep 26, 2012 9:41 am
by ishkabible
I'll have to look at what is needed for Go to work. I found Rust which only requires a 'malloc' and 'free', it uses reference counting it seems.

I know about LuaJIT but I'm a bit worried it wont be very portable even though x86 is supported. I suppose it would just need an allocation function to allocate executable code space.

I'll also look at Obj-C too, see whats needed for it to work.