Closed rafaelcn closed 7 years ago
I will add this issue to the milestone 1.0
Really? Shouldn't we put another milestone to implement our new ideas and close the 1.0 ASAP? The dead line is tight!
@rafaelcn OK! You've got a strong point there! Thanks for this issue, though! :)
Nice issue
So as you all are here you should help to decide which one of the behavior we should implement:
--out=<bin_name>
Vote! I'm to the 1 option.
I vote to do like others interpreters. Like lisp and python. -c
flag denotes compile to machine language and save the file for standard like source-name.bc
considering the usage of extension b
as the natural extension for brain
I agree with @ryukinix regarding using flags! :)
But only making a point here, Brain extensions are .b
, .br
and .brain
and I think that we should include .bf
, as Brainfuck itself uses .b
and .bf
.
I will also add .wit
Why .wit
?
Wit
is a form of intelligent humour, what is close to what Brain
is. It is also 3 chars
long, as mentioned and proposed by @leonardo neumann
Included .bf
and .wit
on https://github.com/brain-labs/brain/commit/fa350046475298f0a2528bc38cb03a5f43668951
We are generating the *.o
file at the https://github.com/brain-labs/brain/commit/70fbef26bc237a484d4635a2d3c961dbbd627be2 . I believe that I will leave like that, once clang
itself uses ld
- Explanation here and other people use gcc
- Explanation here. There is still other ways of doing that, but all of them use external tools and I don't like it. For that, I think that I will leave up to the user to use a Makefile
and this would also solve https://github.com/brain-labs/brain/issues/15. What do you guys think?
Brain now has 3 new flags to solve this issue:
-c
Generates object code-S
Generates assembly code--out=<filename>
Sets the output filename // only works together with -c or -S
We will not generate binary directly because of the problem that I mentioned above. Checkout the commit https://github.com/brain-labs/brain/commit/b3ebaeda2babefa377c9bc3e249070dc85ec4bb3
The compiler should also, besides being a JIT compiler, read a brain file and generate an executable, the discussion is concerned on to whether the compiler should generate it only when requested, throught a flag, or it would generate the binary when called, like gcc and other compilers do.