from Hacker News

Hazel: A live functional programming environment featuring typed holes

by deepakkarki on 10/31/24, 6:57 AM with 86 comments

  • by mmastrac on 10/31/24, 9:15 PM

    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.

  • by agentultra on 10/31/24, 8:39 PM

    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...

  • by disconcision on 10/31/24, 11:43 PM

    happy to answer hazel questions; ive been working on hazel as cyrus' phd student for the last four years, and am currently working on moldable projectional interfaces for live programming in hazel. here are some of the things ive added to hazel: https://github.com/hazelgrove/hazel/pulls?q=is%3Apr+author%3...

    and here's me speaking last week about using typed holes and the hazel language server to help provide code context for LLM code completion: https://www.youtube.com/watch?v=-DYe8Fi78sg&t=12707s

  • by dang on 10/31/24, 8:13 PM

    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)

  • by vosper on 10/31/24, 7:51 PM

    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?

  • by sheepscreek on 11/1/24, 1:24 AM

    Just came here to say that the editor UI is beautiful, works really well - even on mobile. Color me impressed.
  • by jbjohns on 11/1/24, 12:14 PM

    Interesting. I didn't notice any reference to Idris [1] but that was the first place I saw this style of development.

    [1] https://www.youtube.com/watch?v=mOtKD7ml0NU

  • by virtualritz on 11/1/24, 11:43 AM

    I tried the playground on my Android phone and none of the key presses get through to the source code.

    I can position the cursor by tapping and I get a virtual keyboard but I can't type anything.

    Is this a bug or am I just missing something because If terrible UX?

  • by davesnx on 10/31/24, 8:50 PM

    I always loved hazel, probably a great tool to teach. What has been build with it?
  • by hoistbypetard on 11/1/24, 2:04 AM

    My first thought was the Mac app that's been around for about 18 years now:

    https://www.noodlesoft.com

    And it had a release today.

    https://www.noodlesoft.com/release_notes

    Seems rough to jump on a name that's been in continuous use for that long. Would it be hard to add another word to make it easier to disambiguate?

  • by imglorp on 11/1/24, 4:14 PM

    Interesting syntax: all the "let" bindings end with "in", eg

        let comparison =
          (0 == 0, 0 < 1, 1 <= 1, 2 > 1, 1 >= 1) 
        in
    
    Anyone know why "in" keyword?
  • by keeganpoppen on 11/1/24, 3:53 AM

    this seems like it's likely inspired by Idris, to which i say: awesome!
  • by jlkuester7 on 11/1/24, 12:38 PM

    Not sure if I have just spent too much time in the JS/TS world and so I have forgotten the pain in this area in proper compiled languages, but to me it seems like needing "typed holes" smells like maybe there is some abstraction missing in your codebase.

    I prefer to have code layered in a way that my inflection points happen across well defined interfaces. Then I can make changes one layer at a time in increments that are small enough to still be able to reason about. But maybe I am totally mising the point of typed holes!

  • by boogerlad on 11/1/24, 3:58 AM

    How does this compare to lamdu?
  • by ineil on 11/1/24, 8:43 AM

    So if I’m told I have an A type personality and am also often called an A hole does that mean I can concatenate both to create the compound condition of having type holes?
  • by aassddffasdf on 10/31/24, 7:55 PM

    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).