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.
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.
ACPUL works well even with partially broken code keeping programs free from crashes and freezes. Some functions were broken for a long time, but this didn’t block progress allowing me to complete 90% of important features and fix them after 10 years. This has been verified over time in practice. I believe even 30-50% of a program can work opening up many new possibilities.
$ 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"
$
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?
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.
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...
This is probably naive but: How does this differ from something like “declare a type, implement it with methods that all throw NotImplementedException”?
As in, is this “just” a less boilerplate-heavy version of that, or is it more capable?
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...
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.
its a bug. we should be clearer that we dont 'officially' support mobile yet (in that no-one regularly tests with it) but the no keyboard insertion thing is a chrome-specific issue (it works on firefox but there are other issues there)
My first thought when viewing your link was the name "Hazel" which has been around since the late 19th century or so. Couldn't the devs have chosen a different name or added another word?
Jokes aside, name collisions are bound to happen. These two apps seem entirely unrelated so I doubt anyone will accidentally install "Hazel, the Mac app for organizing folders and files" when they meant to use "Hazel, the live functional programming environment organized around type holes."
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!
I'm not sure I understand your point. Typed holes aren't trying to get rid of the concept of interfaces or well designed abstractions. Rather they aim to help deal with incomplete programs that are still under development.
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?
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.
mmastrac|1 year ago
It was honestly one of the most productive environments I ever worked in, and I'm somewhat sad nobody else has implemented this.
spockz|1 year ago
fire_lake|1 year ago
It does sound like a good feature though - very few languages have opt-out type checking. This is much better than opt-in IMO.
ellis0n|1 year ago
kreyenborgi|1 year ago
WantonQuantum|1 year ago
diegs|1 year ago
tomcam|1 year ago
agumonkey|1 year ago
agentultra|1 year ago
Agda has them too and they're more powerful there: https://agda.readthedocs.io/en/latest/language/lexical-struc...
epolanski|1 year ago
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...
cies|1 year ago
disconcision|1 year ago
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
jakewins|1 year ago
As in, is this “just” a less boilerplate-heavy version of that, or is it more capable?
conartist6|1 year ago
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
riffraff|1 year ago
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?
dang|1 year ago
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)
vosper|1 year ago
But does it any more than a live editor and type checker? Can you actually create a program that does something?
disconcision|1 year ago
sheepscreek|1 year ago
jbjohns|1 year ago
[1] https://www.youtube.com/watch?v=mOtKD7ml0NU
virtualritz|1 year ago
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?
disconcision|1 year ago
davesnx|1 year ago
hoistbypetard|1 year ago
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?
nozzlegear|1 year ago
Jokes aside, name collisions are bound to happen. These two apps seem entirely unrelated so I doubt anyone will accidentally install "Hazel, the Mac app for organizing folders and files" when they meant to use "Hazel, the live functional programming environment organized around type holes."
imglorp|1 year ago
arthurbrown|1 year ago
Hazel appears to be written in ocaml and mentions being "ml-like" on the site
moomin|1 year ago
Haskell does the same thing.
keeganpoppen|1 year ago
jlkuester7|1 year ago
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!
7h3kk1d|1 year ago
mrkeen|1 year ago
A hole is the answer to this question. You ask the compiler "what abstraction is missing?" and it tells you.
boogerlad|1 year ago
ineil|1 year ago
aassddffasdf|1 year ago
aithrowawaycomm|1 year ago
noelwelsh|1 year ago
* 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|1 year ago
wyager|1 year ago