4 ms·
I agree with this, but it leads to another principle that too many languages violate - it shouldn't fail to compile just because you haven't finished writing it
by astrange 1y ago
I agree with this, but it leads to another principle that too many languages violate - it shouldn't fail to compile just because you haven't finished writing it! It should fail in some other non-blocking way.
But some languages just won't let you do that, because they put in errors for missing returns or unused variables.
- Terr_ 1y agoI feel that's a use case for compiler flags that convert warnings to errors or vice-versa, where the same source-code can either be "good enough to experiment with" or "not ready for release" depending on the context.
- kmoser 1y agoHow is it supposed to compile if you've written something syntactically invalid? You can make the argument that the compiler could interpret it in (perhaps even arbitrary) valid way that constitutes a valid syntax, but that's almost worse: rather than being chided with compiler warnings, you now end up with code that compiles but executes indeterminately.
- disconcision 1y agothere are approaches to ensure you always or almost always have syntactic validity, e.g. structured editing or error correcting parsing, though of course it's true that the more permissive the system is the more tortured some of the syntactic 'corrections' must be in extreme cases. the approach we're taking with http://hazel.org http://hazel.org (which we approximate but don't fully succeed at yet) is: allow normal-ish typing, always correct the code enough to be ran/typechecked, but insert placeholders/decorations to telegraph the parse structure that we're using in case of errors or incompleteness.
- mackeye 1y agoi saw hazel mentioned forever ago in an eecs 203 lecture and it sent me on a multi-year fp/type theory rabbit hole :) thanks for your work on it!
- conartist6 1y agoHazel has embedding gaps but they are language and editor specific. BABLR takes Hazel's idea and takes it about 18 steps further, potentially making embedding gaps a feature of every editor and programming language. As long as solutions don't have a way to scale economically they'll be academic, but BABLR makes this not academic anymore.
- disconcision 1y agointeresting!! is BABLR yours? is there a page that talks about your error-correcting/embedding-gaps approach? couldn't immediate find one in the docs. btw new version of tylr (hazel's core editing engine) is multi-language from the ground up, with a javascript grammar underway; new version is not yet online though
- conartist6 1y agoIt is! Our approach to error correcting is not to error correct. We instead help the user be highly effective while passing through incomplete states but not invalid ones. Gaps are present in the embedded code representation, e.g. if · is a gap we would represent the result of parsing `console.log(·)` using a "gap tag" (written `<//>`) in a CSTML document that will look like this: https://gist.github.com/conartist6/75dc969b685bbf69c9fa9800cbfddb3f#file-index-cstml-L26 https://gist.github.com/conartist6/75dc969b685bbf69c9fa9800c...
- astrange 1y agoWell I don't literally mean finished as in you haven't finished typing it. Although that's possible too - whitespace languages like Python tend to just work since they don't have end brackets, I suppose. But you could have a compiled language where errors were limited to the function when possible, like by emitting asserts.
- jibal 1y agoThey didn't say "syntactically invalid".
- sorrythanks 1y agoPerhaps we are talking about programming with holes: https://hazel.org/ https://hazel.org/
- jibal 1y agoZig is the worst that way.
- Bolwin 1y agoWhich is silly because it could be among the best since it has line by line lime compilation. I hope someone makes a fork that lets you disable those silly errors in debug mode
- jibal 1y agoAndy Kelley is a smart guy but being so damned opinionated and enforcing it in the language is a very bad idea. Zig is not a replacement for C if it forces people to code the way Kelley thinks they should code. Forking a large and very active project like this is a mug's game.