[HN Gopher] Hazel: A live functional programming environment fea...
       ___________________________________________________________________
        
       Hazel: A live functional programming environment featuring typed
       holes
        
       Author : deepakkarki
       Score  : 92 points
       Date   : 2024-10-31 06:57 UTC (16 hours ago)
        
 (HTM) web link (hazel.org)
 (TXT) w3m dump (hazel.org)
        
       | vosper wrote:
       | I like the way the code examples work: A live editor with
       | documentation that shows up on the right hand side (click the
       | Play with Hazel) button.
       | 
       | But does it any more than a live editor and type checker? Can you
       | actually create a program that does something?
        
       | aassddffasdf wrote:
       | Elm/ML is an interesting choice of mis-mash & a subtle slap in
       | the face of Haskell? (Which on the surface is far more like Elm
       | than ML is).
        
         | colonwqbang wrote:
         | I thought the same thing. "Hazel" sounds like a play on words,
         | a "Hazy Haskell"? Or is it because hazels and elms are trees.
        
         | noelwelsh wrote:
         | My reading is:
         | 
         | * Elm because Elm focused on making the language pleasant to
         | use, and Hazel is in the same tradition of combining HCI + PL
         | 
         | * ML because Hazel is a strict / eager language, and people
         | talk of ML family languages, of which Haskell is one.
         | 
         | So I don't think omitting Haskell is meant to be a slap in the
         | face.
        
         | aithrowawaycomm wrote:
         | This seems like an attempt to stir up a flame war. Hazel is
         | written in ReasonML and uses OCaml-style syntax, and the Elm
         | influence is in the design of an interactive programming
         | environment based on running the program as you edit it. I
         | think they could have said SLIME/ML and conveyed a similar
         | idea. I strongly doubt the authors have anything against
         | Haskell.
        
         | wyager wrote:
         | I would take that to mean "strict evaluation" and "simple type
         | system"
        
       | dang wrote:
       | Related. Others?
       | 
       |  _Hazel: A live functional programming environment featuring
       | typed holes_ - https://news.ycombinator.com/item?id=24299852 -
       | Aug 2020 (14 comments)
       | 
       | Also:
       | 
       |  _Tylr: Demo of tile-based editing, a new kind of structure
       | editing_ - https://news.ycombinator.com/item?id=27926758 - July
       | 2021 (40 comments)
        
       | agentultra wrote:
       | Haskell has type holes. There are plugins that give you code
       | actions to complete them, split case, etc. I love type holes.
       | 
       | Agda has them too and they're more powerful there:
       | https://agda.readthedocs.io/en/latest/language/lexical-struc...
        
         | epolanski wrote:
         | Typescript has a hole type too implemented in fp-ts and effect-
         | ts.
         | 
         | Super useful for when you don't know what are you missing and
         | get a type signature for it.
         | 
         | It's mostly useful for when you declare some `const foo: (bar:
         | Bar) => Whatever` and in the midst of your implementation you
         | don't know what you're missing.
         | 
         | Requires an advanced level in TS to be used to the max.
         | 
         | https://gcanti.github.io/fp-ts/modules/function.ts.html#hole
         | 
         | https://effect-ts.github.io/effect/effect/Function.ts.html#h...
        
       | davesnx wrote:
       | I always loved hazel, probably a great tool to teach. What has
       | been build with it?
        
       | mmastrac wrote:
       | This is semi-related to one of the killer features of Eclipse
       | that never really made it into any large-scale systems: the
       | ability to run incomplete or broken code. The Eclipse Compiler
       | for Java had a special feature that it could generate bytecode
       | for nearly any file, including those that were utterly broken. It
       | would mostly work, and you could incrementally work on unit tests
       | alongside the code being developed.
       | 
       | It was honestly one of the most productive environments I ever
       | worked in, and I'm somewhat sad nobody else has implemented this.
        
         | tomcam wrote:
         | I have never heard about this before. What exactly would happen
         | to broken code? For example, would it skip the equivalent of
         | the broken source line, or would it stub out a function
         | altogether or what?
        
           | gmueckl wrote:
           | I only used that feature inadvertently a long, long time ago.
           | As I remember, the program would throw a Throwable exception
           | when it would enter code that wasn't translatable. There was
           | some sort of hot reloading, too. So you could try to fix the
           | code and continue.
           | 
           | The really neat thing was that the Ecliose Java compiler is
           | built specifically to support the IDE, so all the the warning
           | and error annotations in the editor come from the actual
           | compiler even while you are typing. There is no separate
           | parser and linter just for the editor. I believe that the
           | ability to translate broken source files on a best effort
           | basis is actually an offshoot from that functionality.
        
           | mmastrac wrote:
           | Literally that, it would throw exceptions with the compiler
           | error. And as a sibling comment mentioned and I had forgotten
           | -- it would allow for hotpatching code at runtime as you
           | fixed compiler errors.
           | 
           | You could literally start the skeleton of a webserver and
           | gradually add functionality to it without recompiling and it
           | would mostly "just work". Certain changes would require the
           | app to be restarted.
        
       ___________________________________________________________________
       (page generated 2024-10-31 23:00 UTC)