9 ms·
I want a language that is designed alongside an editor/IDE. I want to stop putting comments in my code. I want it to be first-class for my code to be in the lef
by Waterluvian 8y ago
I want a language that is designed alongside an editor/IDE. I want to stop putting comments in my code. I want it to be first-class for my code to be in the left pane and my comments to be in the right pane, always binded together with anchors but always separate so my comments don't have to adhere to the limitations of the code's text area.
And then I want to put rich things into my comments section like graphics and tables and such. And I don't want to have to write table-like Markdown or a shorthand that converts into graphics. I want all the WYSIWYG of Word or PowerPoint or Inkscape just right there feeling 100% natural and native.
Jupyter is pretty darn close to this. And I like it a lot. But I feel like I'm giving up a lot to make a notebook. I want this in a much more heavy lifting format.
- maxxxxx 8y agoYou could probably achieve this with an IDE that understands your rich text comments (maybe code them in JSON or base64 binary). To me it seems like a pure presentation problem.
- mr__y 8y agoThis.It is already happening. For example, for annotations in some PHP frameworks. The annotations are created as comments in some specified format and then the framework uses reflection to read and parse those comments. Some IDEs can also parse those comments making it somewhat similar to what GP suggested although in a very primitive and simplified form
- infinite8s 8y agoPeople forget ASCII is just a presentation mode. There's no reason for Ox41 to be an 'A'.
- divbzero 8y agoI like this idea. It could take literate programming [1] to the next level. Existing tools like docco [2] can output beautiful documentation [3] with comments set alongside code. The language/editor described above would allow us to input code in the same side-by-side format. [1]: https://en.m.wikipedia.org/wiki/Literate_programming https://en.m.wikipedia.org/wiki/Literate_programming [2]: https://github.com/jashkenas/docco https://github.com/jashkenas/docco [3]: https://underscorejs.org/docs/underscore.html https://underscorejs.org/docs/underscore.html
- lincpa 8y agoMarkdown Literary programming that doesn't break the syntax of any programming language. Literary Programming, Programming was the first, Literary was the second. the main purpose of the Code comment area markup method is to live Preview directly in the Code Editor Preview panel without exporting or any preprocessing. Just add a line comment character of the programming language before each line of Markdown. In the comments of code, you can draw flowcharts, tasklist, display data visualizations, etc. The method is to add extension instructions in any programming language comment area: markdown manual eval code, live eval code, print result, display data visualization and other directives When previewing or converting a format, you only need to simply preprocess: delete line comment characters with regular expressions, example: sed 's/^;//' x.clj Note: line comment character of Clojure(Lisp) is ; line comment characters of the current file type can be obtained from the editor's API. when we edit the code, we can preview the effect in real time. Editing literary code has a live preview panel like most markdown editors. Advantages fast, live, simple, no interference. It don't break the syntax of any programming language, you can compile directly. comment area markup method can be applied to any programming language and any markup (including Org,rst, asciidoc, etc.), which is the greatest advantage. you only need a single line code to delete line comment characters using regular expressions, then you can use any Markdown parse or converter. Support any code editor that supports Markdwon Live preview, allowing the source code of any programming language to become rich text in real time. In the code's comment area, You can use the markdown to draw flowcharts, tables, task lists, and display images on the live preview panel, enhance the readability of your code. If you extend the Markdwon tag, you can implement the eval code, print result, display data visualization and other instruction tags, to achieve live programming, live test. When writing (reading or refactoring) code files, It can modify and live preview directly in the editor without exporting or any preprocessing. Reliable. Maximum code accuracy is guaranteed, and markup language errors do not affect the code. It hasn't interfere anyone to read the code. Markdown is simple, so if it doesn’t have syntax highlighting, it doesn’t have much effect on writing and reading. And having a gray comment area doesn’t affect reading code, especially for people who don’t understand the markup language. Strict distinction between markdown and code, and gray comment area can reduce the amount of information in the source code file, conducive to reading code. https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/markdown_literary_programming.md https://github.com/linpengcheng/PurefunctionPipelineDataflow...
- divbzero 8y ago> I want all the WYSIWYG of Word or PowerPoint or Inkscape just right there feeling 100% natural and native. This specific bit reminds me of the elegant UX implemented in Typora. [1] [1]: https://typora.io/ https://typora.io/
- abecedarius 8y agoIn the 80s at FORTH, Inc. we had 'shadow blocks'. Forth code would go in one block and comments in the corresponding shadow block, and you'd flip back and forth with a keystroke. (We only had 80x25 text mode for coding, iirc. Your graphics would've been out of reach.) I don't remember how or if people kept the shadow comments lined up with code (I was only there for one summer in high school), but you could extend the editor with ease, so...
- slavapestov 8y ago> We only had 80x25 text mode for coding, iirc. Traditionally a block was 64x16 I think (1KB).
- abecedarius 8y agoRight -- I mean that was the only text mode the hardware supported, unless you had an EGA adapter which could squeeze in 80x43. Side-by-side blocks were right out.
- solipsism 8y agoI want a language that is designed alongside an editor/IDE. Why would this require a new language? And why would it require a new editor? For one thing, at a certain scale, code and documentation are examined in a browser more often than in an editor. Your requirements seem too focused on insignificant details and not enough on the big picture.
- mr_toad 8y ago> WYSIWYG WYSIWG is what you get, but not what you want. Anyone who has done serious work in Word, or some other WYSIWG editor has got to the point where the document becomes FUBAR, and you have to copy the plain text, and start again with a new document. That is not acceptable for a programming environment. Copy an paste is the enemy of correctness.
- heavenlyblue 8y ago>> WYSIWG is what you get, but not what you want. Nothing stops you from allowing the user to access the document itself to clean up the automatically-created mess. It should be more like the XML/visual editing modes of .Net platform UIs.
- disconcision 8y agomultiple projection modes. 'canonical view' is raw markdown/tex/whatever with text-editing controls. WYSIWYG view is presentation style with rich text editing controls. this paradigm could carry over to the code itself with projections omitting/adding type annotations, comments, in-lined documentation, maybe even selectively expanding/eliding parts of the code itself i.e. orthogonal aspects like logging
- gota 8y ago> Anyone who has done serious work in Word, or some other WYSIWG editor has got to the point where the document becomes FUBAR, and you have to copy the plain text, and start again with a new document I'm sorry but, speaking from experience, that is just not true in all cases. Granted, it takes a certain kind of methodic work (and more know-how of the tool than would be reasonable) to work around many of the problems but if you put in the time to learn, Word (and similar software) is more than adequate for large-scale editing work. It's no wonder the absolute majority of people use it; the learn how to avoid the problems (or live with them) and there is near zero incentive to personally switch. The majority of the onus is paid by the next batch of people who have to learn it. I'll also agree that it's not what I want for comments and that better models exist for 90% of all text-editing tasks out there. But it does work
- danielovichdk 8y agoI really like the idea of having better options for commenting right by your code. I do believe a lot of code would benefit from better built-in documentation, which it essentially is. I Will think about this some more
- amrrs 8y agoFor R programming, Rstudio has got a notebook-type but within IDE a format called `Rmarkdown` that's pretty popular in academia.
- EliRivers 8y agoThis sounds like literate programming of some kind. A bit more advanced than Knuth's original WEB implementation, but certainly matching the idea that your code co-exists with discussion and diagram and so forth. I used noweb at a previous employer, and it certainly was difficult to argue with the results; beautiful, readable documentation that existed as a first-class product, alongside the code it was describing. The quality of the software we generated was the highest I've ever seen in terms of things like deadlines and budgets and bugs and testing.
- FabHK 8y agoThat's what it sounds like. So, it's pure text (and easy to version control), and you can compile it two ways: Once for the machine to execute, once for humans to read.
- klyrs 8y agoThe code-to-IDE transformation described here could be trivial. Right-pane only shows comments, which are neatly folded away in the left-pane. Doesn't really scream "next level" to me but I'd definitely use it.
- chubot 8y agoI don't think this is a good idea, and I don't think it will ever happen on a large scale, simply because programmers use different editors for valid reasons. It's a dealbreaker if everybody working on the same project has to use the same editor. Development practices that seem suboptimal for the individual are often optimal for teams. And teams develop all the major pieces of software we use.
- moring 8y agoUsing the same editor is not implied though. Only a common format for "rich" comments that is supported by a sufficiently large subset of editors. This could be as simple as using the same markdown/HTML/whatever comments as before but with WYSIWYG support in the editors.
- brylie 8y agoOne example of a project that is sort-of heading that direction is Jupytext https://github.com/mwouts/jupytext https://github.com/mwouts/jupytext
- em-bee 8y agosmalltalk, in particular pharo smalltalk, is doing exactly that. i don't think it supports including graphics in comments, but there is no reason that couldn't be changed. to top it off, it had the potential for that already since its inception. so not exactly a new paradigm
- AllegedAlec 8y agoI'm also becoming a fan of Pharo the more I use it. It just feels so good to use. My only complaint about it is that I really miss ctors with arguments. I don't like init functions; an object should know from its inception the basic things it needs to in order to function, and I think it's a great miss there is no real way to force this.
- em-bee 8y agoi am not familiar with actors, but i'll read up on that. however your second point sounds kind of logical, so i wonder what the problem is here. can you give an example of how an init function is used to do something that an object should already know?
- AllegedAlec 8y ago> actors Sorry, I should've been clearer there. I meant constructors. > can you give an example of how an init function is used to do something that an object should already know? The only way to instantiate a new version of an object in Pharo is with the new message to the class, for example with aDate := Date new However, that point does not yet know what its time offset from epoch is, which is absolutely vital when trying to use a date. It needs to be instantiated at construction with that information. How pharo gets around is by essentially creating class messages which hand you back the instantiated object, such as with aDate := Date year: 2015 month: 12 day: 31 However, this is just syntactic sugar (as far as I can tell, please someone correct me if I'm wrong) for a class message calling new and setting the properties on the object it just created. It is a fairly clean way to create objects, in general. However, the method 'new' can still be used (there is no access modifiers in Pharo), so it's still possible to call an object without ensuring it's initialized properly. I have yet to find a good way around this.
- thecupisblue 8y agoI'm working on something similiar but way different. High-level REPL with a UI editor enabling you to rapidly develop over multiple levels of abstractions that end up doing token translations to existing or provided custom implementations. You'll basically define data, define flow and persepctives on data and that's it.
- santafe 8y agoYou can do that for example with Haiku, so the comments would be saved as extra attribute. Sadly you would lost it if you move the sources to non-extra-attrib friendy FS. On Haiku some editor already using this functionality to save the cursor position, window size and position, current selection, etc as attribute.
- otabdeveloper2 8y agoNo, you don't want this. Every new generation of new programmers since the 1960's talks about this, but nobody to date has actually written any useful program using pictures and prose. Sorry. Code is code, that's what your job entails and you can't make programming into something it isn't.
- pauljurczak 8y agoCode is code, but sometimes pages of code implement a simple mathematical equation or a process diagram. I would like to see it in addition to the code.
- a1369209993 8y agoTo be fair, Waterluvian was talking about including pictures and tables and such in comments, while still writing actual code. It's probably still a horrible idea, but for much more subtle (and less certain) reasons than "waaah, I don't want to have to do programming in order to make a program".
- fiedzia 8y agoPython+sphinx allows to get that (and a lot more).
- theaeolist 8y agoWould it be "a horrible idea" to include diagrams in code that implements a graph algorithm, or images in image-processing code?
- 8y ago
- airstrike 8y ago> I want a language that is designed alongside an editor/IDE. Check out Luna https://www.luna-lang.org/ https://www.luna-lang.org/
- AllegedAlec 8y agoIsn't this a good description of stuff like Pharo?
- gambler 8y agoYes. Everyone should check it out: https://pharo.org/ https://pharo.org/ They have a pretty friendly community too.
- fiddlerwoaroof 8y agoParticularly GToolkit which is built on top of Pharo.
- baron_harkonnen 8y agoThe future of programming languages is and has always been to simply reinvent smalltalk. Seriously, read the original "Design Principles Behind Smalltalk" [0] and it still sounds very fresh, even radical today. [0] https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.html https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk....
- profalseidol 8y agoProjectional editing? https://en.wikipedia.org/wiki/Structure_editor https://en.wikipedia.org/wiki/Structure_editor I've seen that demo from JetBrains MPS, looks good. Hopefully it gets wide usage.
- alkonaut 8y agoAny language should be if not developed by the tool developer, at least developed with tooling in mind. Compiliation for an editor (partial/incremental) is a very different beast from "normal" compilation, and any compiler that is first completed for regular compilation and then tries to address tooling as an afterthought, will ultimately never be useful in tools. I realize writing a new compiler is hard enough in itself, but projects like the Roslyn poject shows it's at least feasible to make a compiler-as-a-service with both regular compilation and tooling in mind.
- chriswarbo 8y ago> Any language should be if not developed by the tool developer, at least developed with tooling in mind. I completely agree. A few things I think would help with this: 1) Provide a standard "machine readable" concrete syntax for the language, alongside any "human readable" syntax. S-expressions would work well for this; if someone prefers JSON or XML then I won't argue. The implementation (compiler or interpreter) should have a mode which converts the human syntax to the machine syntax. The compiler/interpreter should handle inputs in either format. This avoids tools having to parse human-readable formats (or worse, run arbitrary preprocessors, etc.), and makes it easier to feed auto-generated or modified code into the system (e.g. for type checking, etc.). Machine-readable formats are also be more robust, since everything's delimited in a standard way, so unknown things (e.g. new language constructs) won't mess up the parsing of everything else, making tooling easier (e.g. linting, documentation generators, etc.). Note that Lisps and Schemes have this already, by virtue of using a machine-readable language as their human-readable language. Others can maybe just serialise their parser's output (as long as it's concrete, not abstract). 2) Allow arbitrary metadata to be attached to pieces of the syntax tree (in both formats). This can be used for comments, but also for source location (e.g. if it's been translated from the human-readable format, or maybe even transpiled from something else). The parent's desire for graphics, etc. in comments could be handled by such annotations, since they're data not just ignored bytes, so they could have e.g. entire Scribble documents attached. Tooling can use this for any data they like, e.g. hints for static analysers, dependency information, required language version/features, blame information, optimisation hints, etc. I think Clojure already allows this, but I've not used Clojure. 3) Keep context/configuration close to the code, or at least allow it to be. For example, if the meaning of some code changes depending on language version, it should be possible to specify the language version as part of that code. That way, tooling is able to obtain and use that information. This could use the annotations from (2). The worst case is when crucial information (like language version, or which arbitrary program to run as a preprocessor, etc.) is kept in some external configuration file, in an arbitrary location, in some bespoke file format, such that no other tooling can make sense of the code (I'm looking at you Cabal!). Even if we want separate config files, the tools which handle them should be able to resolve and propagate that information into the code, e.g. we could ask `tool annotate src/foo.lang` to get a copy of `src/foo.lang` which any relevant context/metadata from the config file appended as a file header. IDEs can use this to get more info about the files they're editing, and propagate that info into the snippets they send into the implementation for type-checking, etc.
- Razengan 8y ago> And then I want to put rich things into my comments section like graphics and tables and such. Swift Playgrounds has rich comments, but they are still inlined with code.
- dTal 8y agoRacket isn't perfect but it's the best example I know of. In DrRacket you can have image literals.
- ccozan 8y agoWhy not using git, as in every significant code section, which deserves a comment shall be commited and commented freely in the git commit message? Then what you need is just a git blame(?) to visualize the current code section's comments. Would this work?
- ivanbakel 8y agoThat would require a commit to be localised to a block of code, and even atomic commits can be split across multiple files and modules. Plus, you would end up in a conflict between recording history and recording the present. What happens if you replace a complex method call across a codebase? The comments should explain the call, but the commit message needs to record how the call changed, and why - which you probably don't care about when coding.
- zaarn 8y agoTempleOS can put graphics and formatted text into your source code, it does a lot of other neat things I wish modern computers did.
- thrower123 8y agoI've yet to see anybody that really bothers writing comments or documentation, and, more importantly, keeps it updated to match reality. This is only getting worse these days, where even major libraries and frameworks from Fortune 50 companies barely have autogen'd javadoc-style information available.
- enriquto 8y ago> I want all the WYSIWYG of Word or PowerPoint or Inkscape just right there feeling 100% natural and native. There's a thing for everyone, but that dystopian stuff you are describing here I cannot fathom even in my worst nightmares. The text file is a very powerful abstraction for programming and I hope it will never day.
- nikofeyn 8y agotext is terrible for communicating high-level structure and data flow in programs, as well as asynchronous and parallel programming paradigms. it’s clear that if programming is a way of thinking as much as telling a computer what to do then it is well behind nearly every other field in terms of visualizing and seeing and touching the hidden processes.
- mark_l_watson 8y agoNice ideas but you might be better off with a folding editor or IDE where you can hide very long comment blocks. If you haven’t tried a literate programming language, you might like it. You basically write a document with figures, etc. it is, with bits of executable code. BTW, most of my coding in my last job was in Jupiter notebooks (to use Cloud GPU compute). Really not too bad for short ML scripts when you can still put slow changing library code you write in separate files. That said, not a great environment. I prefer configuring ITerm2 or xterm so I can get matplotlib plots to appear inline in SSH sessions.
- deleted 8y ago[deleted]
- carry_bit 8y agoIs there anything in Mathematica/the Wolfram language that falls short of what you want?
- pavelbr 8y agoThe pricetag
- madhadron 8y agoPLT Racket lets you use images and other rich objects in their editor, and provides a framework for rich editors which that editor is written in. So there are pieces there. Block oriented Forths used to use "shadow blocks" for documentation. You had a block that was code, and a fixed offset to a corresponding block that was documentation, with a keybinding to switch between them. Various tidbits of this have been done in Smalltalk (of course). But if you have already invested in a world of tool chains that assume ASCII or Unicode text streams as source code representation, then it's hard to get out of it.
- grawprog 8y agoCNC programming with CAM software is very heavily visually oriented. I don't usually touch a single line of g-code other than to occasionally check certain things. Your comment also reminded me of Godot's editor and gdscript. It's fairly domain specific(though the editor is actually a godot game). Everything's designed to work with gdscript. The language and the editor are designed to work seamlessly together in much the way you describe.
- judepereira 8y agoWhy don't you just use Java + IntelliJ or one of their sister IDEs?