Live data from Hacker News

Hazel: A live functional programming environment featuring typed holes

hazel.org

41–50 of 88 posts

Re: Hazel: A live functional programming environment featuring typed holes

#41

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 w…

Haskell has something like this with -fdefer-type-errors: https://downloads.haskell.org/ghc/latest/docs/users_guide/ex...

    $ cat foo.hs
    something = to be done
    x = x + 1
    wat = x "¯\\_(ツ)_/¯"
    main = print "hi"
    
    
    $ ghc --make -O foo -fdefer-type-errors && echo sucesfuly compoiled && ./foo
    [1 of 1] Compiling Main             ( foo.hs, foo.o )
    
    foo.hs:2:13: warning: [-Wdeferred-out-of-scope-variables]
        Variable not in scope: to :: t1 -> t2 -> t
      |
    2 | something = to be done
      |             ^^
    
    foo.hs:2:16: warning: [-Wdeferred-out-of-scope-variables]
        Variable not in scope: be
      |
    2 | something = to be done
      |                ^^
    
    foo.hs:2:19: warning: [-Wdeferred-out-of-scope-variables]
        Variable not in scope: done
      |
    2 | something = to be done
      |                   ^^^^
    Linking foo ...
    sucesfuly compoiled
    "hi"
    $

Re: Hazel: A live functional programming environment featuring typed holes

#42

Earlier quoted context omitted.

I’m struggling to understand the use, do you have a concrete example?

Brady has a presentation about Idris where he shows Type-Driven development (where you write code that could typecheck with some holes and you get the compiler to help you figure out the missing types for your "whatever/something" untyped variables) https://youtu.be/X36ye-1x_HQ?t=5m15s

This is awesome, but I find that syntax so hard to follow, but that's just me being unfamiliar with it I guess.

Re: Hazel: A live functional programming environment featuring typed holes

#43

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 co…

Congrats, this seems fun and neat!

But small question related to https://hazel.org/build/dev/, given

> Non-empty holes are the red boxes around type errors

... why is the case statement in the list example red-boxed?

Re: Hazel: A live functional programming environment featuring typed holes

#44

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 co…

Congrats, this seems fun and neat! But small question related to https://hazel.org/build/dev/ , given > Non-empty holes are the red boxes around type errors ... why is the case statement in the list example red-boxed?

(Haven’t worked with hazel and I couldn’t find much in the documentation so this may be wrong)

Because that case is non-exhaustive. It will match a list with 0, 1, or 2 elements, but the last arm matches a list with exactly 2 elements, not 2 or more, so as soon as you get to 3 or more elements, there’s no code to execute.

Re: Hazel: A live functional programming environment featuring typed holes

#45

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 w…

Agda (2) has a similar feature called holes. Very similar to Haskell’s `nothing` and Scala’s `???`. The difference is that because of the dependently typedness the compiler can sometimes even fill in the code for you based on symbols in scope.

Re: Hazel: A live functional programming environment featuring typed holes

#46
post #12
post #11

Earlier quoted context omitted.

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?

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 edito…

Common Lisp's REPL works like this.

Re: Hazel: A live functional programming environment featuring typed holes

#47
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?

Re: Hazel: A live functional programming environment featuring typed holes

#48

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 w…

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.

Yes and no. You need a universal way of saying "something that should exist here is missing"

Re: Hazel: A live functional programming environment featuring typed holes

#50

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 co…

Nice to make your acquaintance! I've spent the last four years working on similar tech, though I'm not affiliated with any school or company. I've gone over to the Hazel implementation many times for inspiration and just to check in on the progress.

Here are some of the biggest questions I have:

Do you have any plans to bring editor gaps to languages other than Hazel?

Why is the Hazel editor first a text editor? E.g. it seems 100% happy to let a single poorly judged keystroke create an unbalanced brace or quote pair when it has much more semantically correct options for the next state it could generate...

P.S. Feel free to come check out BABLR: https://github.com/bablr-lang/, https://discord.gg/NfMNyYN6cX

Post reply on HN