News for hackers. Stuff that matters.
Re:Apple Dylan IDE (2014) by DaiPlusPlus on Saturday June 03, 2017 @11:02PM (#14479700)
What I like the most is the abstraction-away from plaintext source files. Imagine a C and C++ IDE that hid the (often ugly) source files from you put only exposed individual function definitions - it could automatically keep header files in-sync, for example, and automatically place each free-function or class member in the right file without manual refactoring.

(I still think it's outrageous that C is still a single-pass language - we shouldn't need separate simultaneous declaration and definitions any more)

Re:Apple Dylan IDE (2014) by jitl on Sunday June 04, 2017 @12:40AM (#14479913)
This is what Lighttable aimed to do - create an extensible, abstracted code editor for many languages. See also CodeBubbles (Java) and most Smalltalk environments.

http://lighttable.com/2012/04/12/light-table-a-new-ide-conce...

Re:Apple Dylan IDE (2014) by melloclello on Sunday June 04, 2017 @01:36AM (#14480045)
> It’s no secret that I really like Clojure and as a lisp, it was the easiest language for me to start the prototype with, but there’s no reason this couldn’t be done for any language with a dynamic runtime. The rest is mostly simple analysis of an AST and some clever inference.

I have looked into this. It is kind of criminal that for most real world languages (Ruby[1], C[2] etc), it's not possible to just define a grammar and throw it at a standard parser generator for them - they generally have one or two quirks which make this infeasible.

In my ideal alternate universe it would be considered unthinkable to publish a language without also publishing a grammar in a standard format for said language, which can then be plugged into your favourite text/semantic/tree editor. Our tools should dictate our languages, not the other way around.

[1] http://programmingisterrible.com/post/42432568185/how-to-par...

[2] https://en.wikipedia.org/wiki/The_lexer_hack

Re:Apple Dylan IDE (2014) by dom0 on Sunday June 04, 2017 @05:50AM (#14480576)
Most programming languages are context-sensitive [1] (at least with unbounded nesting), so parsing them correctly and efficiently is mathematically impossible. All practical implementations have to take shortcuts.

[1] Mainly due to begin..end blocks, curly braces or indentation (as in Python)

Re:Apple Dylan IDE (2014) by Edmond on Sunday June 04, 2017 @09:53AM (#14481595)
Are most programming languages really context-sensitive? or aren't they mostly context-free?

My days of fiddling with writing parsers are long ago (https://www.codeproject.com/Articles/7035/A-Java-Language-ID...) but if I remember correctly most languages aim for at most a LL(2) grammar, meaning they are designed so the parser doesn't have to peek more than two tokens ahead before being able to make a correct determination.

Re:Apple Dylan IDE (2014) by hornetblack on Sunday June 04, 2017 @09:40PM (#14484778)
C has some fun ones:

a * b;

Is either: a times b if a is a var, or declare a varible b with type a. If a is a typedef.

Also:

some_type b = {a, b, c, d};

Is only valid if some_type is an array or a struct. Which is possibly defined elsewhere in the source.

(I tend to see this syntax in some code bases (some_type) { a, b, c, d }, which is a bit better).

Re:Apple Dylan IDE (2014) by wtetzner on Sunday June 04, 2017 @07:47AM (#14480913)
Context free grammars are perfectly capable of expressing matched curly braces, even with unbounded nesting. Am I missing something?
Re:Apple Dylan IDE (2014) by dom0 on Sunday June 04, 2017 @08:58AM (#14481319)
Yes, thinking about it that alone is not sufficient. Still, I'd claim that most languages are not context free.

CPP (Pre-processor) aside, C is not context free due to typedef making identifiers ambiguous. Also if-then-else? Since C++ templates are turing-complete, the grammar is probably unrestricted.

Python is not context free due to

    if ...:
        stmt1
        if ...:
           stmt2
        stmt3
stmt3 and stmt1 have to share the same level of indentation to form a valid Python program, but they might contain arbitrary indentation within brackets.
Re:Apple Dylan IDE (2014) by munificent on Sunday June 04, 2017 @02:27AM (#14480150)
The RealBASIC IDE also give you a function-based editing experience instead of storing entire text files full of code.

It was kind of neat, but also led to a lot of clicking around. It's one of those Holy Grail ideas people have been talking about forever, but I'm not convinced it's actually that superior given all of the ecosystem downsides there are to moving away from text.

I think you probably could do something better than text files, but it has to be a lot better to get over the chasm of losing all of your familiar editors, command line text utilities like grep, easy copy/paste, etc.

Text is a lowest common denominator medium. People get hung up on the "lowest" part, but the "common" part is pretty damn convenient.

Re:Apple Dylan IDE (2014) by carussell on Sunday June 04, 2017 @07:24AM (#14480825)
Re:Apple Dylan IDE (2014) by masklinn on Sunday June 04, 2017 @04:21AM (#14480400)
And Self's Morphic, which went even further ("static" objects would be defined via UI elements with only the method bodies being written in small editors)
Re:Apple Dylan IDE (2014) by tjoff on Sunday June 04, 2017 @04:24AM (#14480404)
(I still think it's outrageous that C is still a single-pass language - we shouldn't need separate simultaneous declaration and definitions any more)

Maybe not, but I have a hard time to believe that it can be considered even a slight annoyance to anyone but people just learning how to program. The same people that are annoyed by it probably benefits from it anyway, forces them to actually think about what they are doing.

Also makes it easier to get an overview of the code using just a text editor. KISS.

Re:Apple Dylan IDE (2014) by coldtea on Sunday June 04, 2017 @08:11AM (#14481045)
>Maybe not, but I have a hard time to believe that it can be considered even a slight annoyance to anyone but people just learning how to program.

Slight annoyances pile up. Ergonomics matter even for seasoned pros. Just because they have learned to ignore the garbage, doesn't mean their room is clean.

Re:Apple Dylan IDE (2014) by tjoff on Monday June 05, 2017 @05:56AM (#14486363)
True, but this truly is a non-issue.
Re:Apple Dylan IDE (2014) by dTal on Monday June 05, 2017 @10:55AM (#14488022)
Seems like status quo bias. If C did not have this wart, no one would suggest adding it just to "force beginners to think about what they are doing" or "make it easier to get an overview of the code using a text editor".

And human factors matter. In the context of language design, they're the only things that matter - the entire function of a programming language is to make a complicated task fit a human brain as neatly as possible.

Re:Apple Dylan IDE (2014) by tjoff on Wednesday June 07, 2017 @12:37PM (#14507789)
no one would suggest adding it

Disagree.

Re:Apple Dylan IDE (2014) by tajen on Sunday June 04, 2017 @05:30AM (#14480524)
Visual Basic / Excel VBA does that, and I thought it was the way to go until 18yo. But when you can only see one function/event handler at a time, you lose the understanding of how programming works. If only I had been exposed to plain-text programming (Maven + .java) instead of using Windows/visual editors for years...
Re:Apple Dylan IDE (2014) by meredydd on Sunday June 04, 2017 @07:49AM (#14480916)
Old-school VB actually shows you all your code (sorry, best video I could find quickly: https://youtu.be/zmyZCmX2LWQ?t=2m21s). They were aware of the issue you raised, having tried separate-function editing as far back as QuickBasic for DOS.

The usability engineering of old-school VB (of which VBA is the modern representative) was frankly top-notch, and I feel no shame following their footsteps in the https://anvil.works code editor.

Re:Apple Dylan IDE (2014) by tcbawo on Saturday June 03, 2017 @11:33PM (#14479764)
Unfortunately, preprocessing would make this difficult or impossible. Even with modern C++, people still rely on it.
Re:Apple Dylan IDE (2014) by nuopnu on Sunday June 04, 2017 @03:47AM (#14480327)
You are thinking of a structured editor.

But as to the single feature you mentioned, see for example Code Bubbles:

https://www.youtube.com/watch?v=PsPX0nElJ0k

Re:Apple Dylan IDE (2014) by jsmthrowaway on Sunday June 04, 2017 @01:37AM (#14480047)
Extremely relevant, particularly his remarks: https://youtu.be/8pTEmbeENF4?t=1174 (19:34 if t= doesn't work).
Re:Apple Dylan IDE (2014) by atjamielittle on Saturday June 03, 2017 @11:05PM (#14479707)
I think I would love this.