
New JavaScript code generator in Idris 2 - ska80
https://github.com/idris-lang/Idris2/pull/415
======
spinningslate
Aside from being an interesting feature, the discussion is a great example of
positively encouraging contributions. There's a lot to admire about Edwin
Brady: smart, kind, polite, self-effacing, committed. Given the prevalence of
acrimony in online discourse - both mainstream and social media - it's always
good to be reminded that there are lots of really decent people out there. And
anyone who names a language after a dragon in a children's animation[0] gets
my vote!

[0]
[https://en.wikipedia.org/wiki/Ivor_the_Engine](https://en.wikipedia.org/wiki/Ivor_the_Engine)

~~~
kryptiskt
Well, a lot of the thread is just me fumbling around with Github features.

------
guerrilla
If you also didn't know Idris 2 was out, check here [1] for what's new.

[1].
[https://idris2.readthedocs.io/en/latest/updates/updates.html...](https://idris2.readthedocs.io/en/latest/updates/updates.html#sect-
new-features)

------
madushan1000
I wonder how much effort would it take to add a rust code generator. I'm
guessing we can't add a C code generator because idris seems to need a garbage
collector.

~~~
gnulinux
Haskell used to be compiled to C. (not sure if they still use this backend, I
think main GHC backend compiles to LLVM). "Doesn't have garbage collector" is
not a good reason not to be able to compile to C, surely garbage collection
can be implemented in C.

~~~
iso8859-1
Just because it is possible doesn't mean it's easy. If you implement garbage
collection in C, you are using your own garbage collector, the C ecosystem
doesn't support you in any way. When people make the argument of preferring a
compilation target because it has a specific feature, they are not saying
"target is not Turing complete, you can't implement this feature". They say
"not natively supported and I would rather not implement this myself".

And no, -fllvm exists, but it is not the default:
[https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_gui...](https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/codegens.html#llvm-
code-generator-fllvm)

------
swagonomixxx
Are there any examples of projects in Idris that do something non-trivial and
non-academic?

E.g, websites, video games, etc.

~~~
saityi
Jan Corazza has some really great write-ups about writing bindings to SDL and
writing a video game in Idris using them. The source is available on Github

[https://flowing.systems/2020/01/13/a-game-in-a-pure-
language...](https://flowing.systems/2020/01/13/a-game-in-a-pure-language-
part-1-introduction-and-problems-with-idris.html)

[https://flowing.systems/2020/04/13/a-game-in-a-pure-
language...](https://flowing.systems/2020/04/13/a-game-in-a-pure-language-
part-2-state.html)

[https://github.com/corazza/game-idris](https://github.com/corazza/game-idris)

------
ch4s3
I've been interested in Idris for quite awhile, but not sure how to go about
learning it. Are there any particularly good resources? Am I expected to know
Haskell or is it sufficient to have a few years of experience with FP in
general?

~~~
mixedCase
You should be good to go picking up "Type-driven development with Idris". It's
a great book not just for learning Idris but also for hammering down the
concept of using types and the compiler as a design pillar if you're not fully
used to it.

~~~
saityi
There's even a page in the Idris 2 docs with updates to the book for Idris 2
--
[https://idris2.readthedocs.io/en/latest/typedd/typedd.html](https://idris2.readthedocs.io/en/latest/typedd/typedd.html)

The book is otherwise still totally relevant for Idris 2 and is a great read &
introduction to dependent types.

