Earlier quoted context omitted.
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.
Hazel will also run incomplete programs around holes. Most untyped languages will just crash as soon as something is incomplete.
Hazel: A live functional programming environment featuring typed holes
71–80 of 88 posts
Re: Hazel: A live functional programming environment featuring typed holes
#72Earlier quoted context omitted.
func TestWhatever(t *testing.T) { // ...lots of code _, _, _, _, _, _, _ = resp3, resp4, fooBefore, subFoo, bar2, barNew, zap2 } Like, I get it, it's a good feature, it caught quite a lot of typos in my code but can I please get an option to turn this checking off e.g. in unit tests? I just want to yank some APIs, look at their behaviour, and tinker a bit with the data.
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warning.
Re: Hazel: A live functional programming environment featuring typed holes
#73Earlier quoted context omitted.
That sounds like an incredibly useful feature. Do you recall what version you were using?
I believe that Eclipse 2.x already had most of these features, but it certainly was in almost all 3.x versions as far as I remember. That IDE was amazingly far ahead of its time. Even 20 years later, tools like VS Code feel like a shocking regression in capabilities to me.
Re: Hazel: A live functional programming environment featuring typed holes
#74Earlier quoted context omitted.
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warning.
You know, for some weird reason, it never crossed my mind to hack the Go compiler to let me do things like that. And it's such a great idea.
Re: Hazel: A live functional programming environment featuring typed holes
#75Earlier quoted context omitted.
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warning.
You know, for some weird reason, it never crossed my mind to hack the Go compiler to let me do things like that. And it's such a great idea.
https://gist.github.com/umanwizard/9793393083a42db933579fe21...
Re: Hazel: A live functional programming environment featuring typed holes
#76This 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…
Re: Hazel: A live functional programming environment featuring typed holes
#77Earlier quoted context omitted.
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. https://gcanti.github.io/fp-ts/modules/function.t…
I’m struggling to understand the use, do you have a concrete example?
const transformFoo: (foos: Foo[]) => Bar
and you start implementing it and get stuck with some callback or whatever you can put a `hole` and it will tell you the type signature of what you're missing.
Re: Hazel: A live functional programming environment featuring typed holes
#78I 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
#79Earlier quoted context omitted.
func TestWhatever(t *testing.T) { // ...lots of code _, _, _, _, _, _, _ = resp3, resp4, fooBefore, subFoo, bar2, barNew, zap2 } Like, I get it, it's a good feature, it caught quite a lot of typos in my code but can I please get an option to turn this checking off e.g. in unit tests? I just want to yank some APIs, look at their behaviour, and tinker a bit with the data.
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warning.
Re: Hazel: A live functional programming environment featuring typed holes
#80Earlier quoted context omitted.
func TestWhatever(t *testing.T) { // ...lots of code _, _, _, _, _, _, _ = resp3, resp4, fooBefore, subFoo, bar2, barNew, zap2 } Like, I get it, it's a good feature, it caught quite a lot of typos in my code but can I please get an option to turn this checking off e.g. in unit tests? I just want to yank some APIs, look at their behaviour, and tinker a bit with the data.
This example isn't particularly good code. If you've got "lots of code" that names a bunch of variables (e.g. using ':=') that are never referenced AND you have a good reason not to do so (which I doubt: given this context it looks like an incomplete test), then predeclare these 'excess' variables: func TestWhatever(t *testing.T) { var resp3, resp4, fooBefore, subFoo, bar2, barNew, zap2 theirType // ...lots of code }…