Add B++ to README#187
Conversation
|
Thanks for sharing @Nv7-GitHub! Really cool to see what you've been working on :) Lovely to see you've developed both a compiler (B++ -> LLVM IR), an interpreter and a transpiler (B++ -> Go)! While you have it fresh in mind, it would be great if you shared some of your experience with using I had a quick look at the source code and from first glance it looks quite clean and well structured. In openBracket = m.NewGlobalDef("openbracket", constant.NewCharArrayFromString("["+string(rune(0))))
closeBracket = m.NewGlobalDef("closebracket", constant.NewCharArrayFromString("]"+string(rune(0))))Since this pattern will be common also for other users of For instance: package irutil
// NewCString returns a new NULL-terminated character array constant based on the given UTF-8 string contents.
func NewCString(s string) *constant.CharArray {
return constant.NewCharArrayFromString(s + "\x00")
}Then - openBracket = m.NewGlobalDef("openbracket", constant.NewCharArrayFromString("["+string(rune(0))))
- closeBracket = m.NewGlobalDef("closebracket", constant.NewCharArrayFromString("]"+string(rune(0))))
+ openBracket = m.NewGlobalDef("openbracket", irutil.NewCString("[")
+ closeBracket = m.NewGlobalDef("closebracket", irutil.NewCString("]")Or something along those lines. So, it would be interesting to hear more about your experience. Especially what parts were a bit frustrating and confusion with using Cheers, Edit: |
|
Thank You! I switched all my strings over to I would say the biggest difficulty was the C standard library - it would be super cool to have a I love this library and it makes generating LLVM a breeze! |
That's a good idea! I know this has come up in the past, so adding something like Happy you enjoyed hacking on a compiler using With kindness, |
Adds B++ to the README