flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Projects and Ideas > more interactive c compiler?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
TmX



Joined: 02 Mar 2006
Posts: 790
Location: Jakarta, Indonesia
Re: more interactive c compiler?

vivik wrote:

I'd like to have a language which is as interactive and easy to use as python, and as powerful and close to metal as c.



The closest one I can think of is Nim (no REPL, though).

Scheme/Lisp implementations have nice REPLs (and metaprogramming feature as well), but on the other side seems like they are not targeted for system programming like C.
Post 14 Sep 2017, 14:28
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 174
https://nim-lang.org/features.html

huh, hello world of 41 kb. Must be because of garbage collection.

All languages seem to either always have or always not have garbage collection. Because if gc exist, it must be build into language, and language should be build according to that. But gc is an overkill in some situations, and isn't necessary if you are careful to always free memory. I hope to turn garbage collection into a debugging feature, and remove it from the final build. I'm not sure how exactly I would make that, memory management is probably more complicated than code generation. I'll probably take a static analysis approach, simply warning a programmer when he forgot to free something. Not sure. I care about the final binary more than about the prettiness of language itself.

Here is a bit more about garbage collection https://board.flatassembler.net/topic.php?p=196423#196423

I feel like a politician right now. Bunch of promises. Think of them as ideas, sense of direction.
Post 15 Sep 2017, 08:33
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 790
Location: Jakarta, Indonesia

vivik wrote:
https://nim-lang.org/features.html
huh, hello world of 41 kb. Must be because of garbage collection.



I'm not a Nim expert (just started learning it).
The interesting thing about Nim is it compiles to C.
Feel free to examine the generated C code.

Or improve the Nim runtime efficiency Smile
Post 15 Sep 2017, 08:51
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 174
Can't really improve Nim beyond certain point. If Nim compiles to C, then it has flaws of C I'd like to fix. Namely being unable to receive multiple return values from a function. (You can do that, but it's not supported directly, you must pass variable's address as one of arguments. It's pretty ugly. Compiler probaly can optimize that away, but I have no idea if it actually does that.)
Post 18 Sep 2017, 08:50
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 174
I wonder if Edit and Continue is patented. I found this, but it's ocr and some figures are not shown: https://www.google.com/patents/WO2015200235A1?cl=en . It's also pretty new, but that function replacing technique is around 15 years old by now.
Post 18 Sep 2017, 09:03
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 174
Meanwhile you can check out http://ziglang.org/ , interesting how it listed both "no garbage collection" and "no dependency on C" right on the front page, two problems I complained about with Nim. It actually passed "4 kilobyte test", but it's still very very raw at the moment. Try donating to him, maybe it will speed things up.

I'm concerned about how that "exception on integer overflow" will look like, need to look at generated assembly. Need to compile the damn thing first.

Internally depends on llvm, and with windows it depends on either visual studio or mingw, I guess for the final assembly->binary and for headers.

The "comptime" feature is really promising, it's zig's way of killing preprocessor for good, and replacing C++ templates. Also, I like how it's goal seems to "simplify and replace C". My goal is to simplify and replace assembly without compromising anything.

Also check out https://luapower.com/winapi , it seems to pass the "interactive" requirement. Don't think the resulting exe file is good though.

There is also Idlewild https://board.flatassembler.net/topic.php?t=18704 , don't think it passes either requirement, but it's focus is also gamedev. Crossplatform, written in haskell. Confused on how to install this thing, so haven't tried it yet.
Post 29 Sep 2017, 07:51
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.