TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hazel: A live functional programming environment featuring typed holes

125 pointsby erwanover 4 years ago

7 comments

sfvisserover 4 years ago
Great! I&#x27;m convinced designing a functional language and IDE side-by-side will result in greatly improved ergonomics. The Hazel playground breaks for me (Safari), but the direction looks promising.<p>One of my own (nearly abandoned) toy projects is something similar. It&#x27;s not easy — at least to me it wasn&#x27;t — to design a language that is forgiving on as many aspects as possible. Both syntactically and semantically. Turning every error into a warning during development time and keep the impact as local as possible. Type errors turn into implicit holes of type bottom, just make sure the IDE is explicit about it.<p>One of the tricks I applied is to use indentation style syntax (like Haskell&#x2F;Python). Now syntax errors only break one level of code. Preventing the IDE from coloring the rest of your buffer red because you still need to type out your closing parenthesis.<p>Edit: I see Hazal takes the valid-by-construction approach, which is different from be-forgiving-but-explicit. Both are approaches worth of experimentation.
评论 #24314847 未加载
kpmahover 4 years ago
I also experiment a lot with structural editing. My latest project is an editor for a lisp-like language for building small audio synth programs: <a href="http:&#x2F;&#x2F;kevinmahoney.co.uk&#x2F;ocellator&#x2F;" rel="nofollow">http:&#x2F;&#x2F;kevinmahoney.co.uk&#x2F;ocellator&#x2F;</a><p>Hazel looks fantastic - I don&#x27;t think I&#x27;ve come across it before. I think an obstacle structural editors have to becoming more widely adopted is that they start out very general and don&#x27;t immediately solve a problem that people have. You can usually build little toy programs but not much more. What I&#x27;ve tried to do is to focus on creating an editor for a small DSL that helps with a specific problem.
评论 #24316962 未加载
loosetypesover 4 years ago
For folks interested in this sort of thing, Andrew Blinn gave a neat talk[1] pertaining to structured editing at Racketcon, which credits Cyrus’ work with Hazel.<p>[1] <a href="https:&#x2F;&#x2F;youtu.be&#x2F;CnbVCNIh1NA" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;CnbVCNIh1NA</a>
评论 #24318985 未加载
ellis0nover 4 years ago
Cool things! Good solution is ACPUL maintains holes in your code, and programs never stop or crash Incomplete expression is reflected in only one node of the code and the whole system continues to work correctly (as architecture design)<p>Code demo:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;web3cryptowallet&#x2F;Web3CryptoWallet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;web3cryptowallet&#x2F;Web3CryptoWallet</a><p>More info about Animation CPU:<p><a href="https:&#x2F;&#x2F;animationcpu.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;animationcpu.com&#x2F;</a>
avmichover 4 years ago
&gt; Hazel is a live functional programming environment that is able to typecheck, manipulate, and even run incomplete programs, i.e. programs with holes. There are no meaningless editor states.<p>Suppose I have an assigned variable, which later I plan to use. When I&#x27;m about to use it, but not yet did, I have a hole. Suppose before filling the hole I&#x27;ve realized that the current type of the variable - and assigned value - is wrong, so I want to use the correct type.<p>Can hole-oriented programming help me with that change of mind? When we use a program, using a configuration file but also allowing command-line overrides of values, we assume last-time command-line overrides have precedence over values in the configuration file. Can we consider later-time use of variable with different type overriding the previous type, which now considered to be incorrect? Of should the language catch us making a type error here?
评论 #24313318 未加载
评论 #24316607 未加载
lambdatronicsover 4 years ago
&gt;we hope that this will allow Hazel to function not only as a structured programming environment, but also as a structured document authoring environment!<p>This is the kind of thing I come to HN to discover! Cool ideas.
philip142auover 4 years ago
Idris has typed holes, how is this an improvement on Idris?
评论 #24313866 未加载