26 comments

  • mmastrac 3 hours ago

    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.

    • fire_lake 17 minutes ago

      Isn’t this possible with any untyped language?

      It does sound like a good feature though - very few languages have opt-out type checking. This is much better than opt-in IMO.

    • WantonQuantum an hour ago

      I use IntelliJ now and I definitely miss this feature of Eclipse.

      • cies an hour ago

        Why? What did you miss about it?

        I'm asking as I prefer strict compilers that force me to handle all cases.

        • WantonQuantum 35 minutes ago

          Generally, it's a very pragmatic thing like being able to quickly run something to make sure it's working but some other part of the code is temporarily broken because I'm currently changing things and don't care that that part is currently broken. In IntelliJ I have to stop doing what I'm currently thinking about and go over to that other part of the code and comment out some things or otherwise fix it up (usually in a way that won't be permanent because it's broken for a reason) before I can run the code I'm working on.

          In an ideal world, the codebase would be modular and testable and all those good things but I work in a large enterprise dev team and some of the codebase is many (many) years old and it's no longer feasible to refactor it into anything like what would be needed to allow the code to be modularized in such a way that would obviate the necessity to do the above.

        • foota 27 minutes ago

          I don't think they want to have thing broken in the steady state, but anything that relies on things building for analysis etc.,. Could benefit from this.

    • tomcam 3 hours ago

      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 3 hours ago

        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 2 hours ago

        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.

        • cies an hour ago

          CRTL-SHIFT-F9 (IntelliJ) works for me on most Java and Kotlin code in IntelliJ, as long as no method/class signatures are changed.

  • agentultra 4 hours ago

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

  • dang 4 hours ago

    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)

  • disconcision an hour ago

    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

  • vosper 5 hours ago

    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?

    • disconcision an hour ago

      we have ~ another year of basic type system and editor features prior to the 'doing something' phase. there are early-stage feature branches with stuff for web GUI programming & data science applications, but parts are awkward without in-progress basics like implicit polymorphism, a module system, and more sophisticated type inference.

  • davesnx 4 hours ago

    I always loved hazel, probably a great tool to teach. What has been build with it?

  • aassddffasdf 5 hours ago

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

    • aithrowawaycomm 4 hours ago

      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.

    • noelwelsh 4 hours ago

      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.

    • colonwqbang 5 hours ago

      I thought the same thing. "Hazel" sounds like a play on words, a "Hazy Haskell"? Or is it because hazels and elms are trees.

    • wyager 2 hours ago

      I would take that to mean "strict evaluation" and "simple type system"

      • disconcision an hour ago

        yes. also keen on first class modules (coming soon to Hazel). syntax could have easily been more haskell-like, current team is pretty ecumenical wrt surface syntax, excepting that i have as yet been unable to convert anyone to the gospel of s-expressions.

        biggest reason more haskelley syntax didnt/hasnt happen/ed is the current syntax engine does not support significant indentation. hazel concrete syntax isn't stable yet though we're also thinking seriously about semi-colons