Glasgow Haskell Compiler

What is GHC? Apparently not just a Haskell compiler.

The smart folks at DAML: The Contract Language of Distributed Ledger (Digital Assets Modelling Language) took a novel path to build an entirely new object-capabilities programming language. Rather than an EDSL (Embedded Domain-Specific Language) approach.

DAML engineering already had developed a smart contracting modelling language. Apparently learning that fine gain OCaps-base language is required for resilient security The Forgotten History of OOP. Over a weekend an engineer put the front-end modelling on GHC back-end removed the unwanted layer to reveal fine grained [OCaps-based]. DAML

> DAML is a separate programming language and they are using GHC, so apparently GHC has never been just a Haskell compiler. Can someone clarify? >For some reasons the DAML guys decided a Haskell-based EDSL was not enough and rolled out their own language. In general, why would someone ditch the EDSL idea and build an entirely new language?

For >95% of GHC users, GHC is in fact a Haskell to binary compiler. That's what it was built for. When you take a closer look though, GHC actually does a lot of compilation "passes" on a variety of intermediate representations: > Haskell source code > Haskell AST (abstract syntax tree) > GHC Core aka System FC > STG (Spineless Tagless G-Machine) > Cmm ("C minus minus") Various backends such as x86 assembly,LLVM, etc. > GHC has an API that allows you to leave the first two/three/... out and just compile Core or STG to assembly. This way you can relatively easily implement a programming language that shares Haskells basic features but has a different syntax. Your programming language will still have all the optimizations that have been developed for Haskell which are probably literal decades of work, since a lot of them are not implemented on the Haskell AST but on those other representations. "Edit: no idea about two, I'd guess that they just disliked some of Haskell's quirks and from the two-minute glance I had at their website it seems like DAML was made for a very specific thing, so I guess they left out some irrelevant language features." More here... page