Hacker Newsnew | comments | show | ask | jobs | submit login

windows version? not everyone is a CS student or academic...

making language tools in windows is actually quite challenging due to the poor quality of tools. its the only thing i've ever struggled with in that area. using haskell and llvm makes it a little easier than using C and llvm but not much...

it would be nice to have a windows friendly set of instructions - setting up GHC, happy, alex etc. isn't hard, but LLVM is a pain for windows.

it would be nice if it was in C rather than Haskell too. imo its highly likely nobody wants to touch Haskell if they have a choice. then the many C tools one might want to use like flex, bison - even win-flex and win-bison are a bit rubbish and difficult to configure for use in windows...

still a very useful article - its great to see an example worked through like this, its one of the best forms of documentation imo and not enough of that around in this area...




> it would be nice if it was in C rather than Haskell too. imo its highly likely nobody wants to touch Haskell if they have a choice.

This is roughly a "port" of the LLVM "Kaleidoscope" tutorial, which is originally written in C++. There's also an O'Caml version.

Haskell is (not coincidentally) an excellent language for writing compilers. "nobody wants to touch Haskell" is just trolling that earned you a downvote.

-----


oh sure, there is a nice mapping between parser combinators and lbnf, however most programmers have little experience of fp and don't want to touch haskell for anything. this might be unpopular, but it has the unfortunate property of being a true statement. i'm happy to be downvoted for 'trolling'

i had seen that kaleidoscope tutorial in the LLVM docs before but didn't remember it particularly or find it helpful - perhaps its the presentation but this site is much more polished than that part of the llvm docs. granted they make the explicit choice to not use lexer/parser generators but that is not as practical in c/c++ as it is with haskell and adds a lot of needless cruft imo.

-----


> making language tools in windows is actually quite challenging due to the poor quality of tools.

This is why the tutorial doesn't use Windows. It would mostly be a tutorial about fighting to get tools installed instead of actually talking about building compilers. The total Haskell source comes out to about 500 lines of code for the whole compiler, the equivalent C would be an order of magnitude larger. It makes no sense to do what you suggest.

-----


Virtualbox runs just fine on Windows, and it's not difficult to set up a linux VM either.

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: