Macros can transform code, much in the sense that code can transform data. And data is simple to query and transform š
Copilot sounds horrible... what about licenses? What about code quality?
You don't want to use macros most part of the time
It's better to not build another DSL
many developers will give you pushback on using meta programming... I think it is best to keep any DSL contained how a micro service approaches things... small and rebuildable.
versus 100k line code base of a DSL
meta programming can save you though... if trying to refactor a difficult code base
there is a very thin line between a rich data structure and meta programming / DSLs
1āļøbuild effective programs that does stuff instead of making things too generic?
Looking for resources for designing a source code editor. Are there any general principles that apply or are the implementations and architecture always platform dependent?
@kslvsunil, check out https://github.com/mogenslund/liquid
Not sure what you mean by platform dependent, but I think most source code editors run on multiple platforms
https://codemirror.net/ is also worth checking out. It's written in javascript, but it's written in a fairly functional style.
Looking for relevant research papers, books, etc. I know there are multiple open source editors but before I start scanning them, I would like to know if there are any general principles that all code editors share? For say syntax highlighting, indexing the code, cursor and selection handling and so on.
Thanks @smith.adriane, Iām aware of Codemirror and itās sibling Prosemirror (I work with prosemirror at work). Prosemirrorās API and design seem fairly generic and platform agnostic, by which I mean, the EditorState and EditorView abstractions can serialise to possibly other formats than HTML. What Iām interested is in knowing if there is a āstandardā way to go about designing code editors.
I needed to make a code-editor component for my UI library and from what I could tell, the "standard" way is to start with codemirror/intelliJ and go from there
Hmm, I want to employ the Apple Pencil, the API for which is only available via Swift/ObjC. So JS/Java runtimes are ruled out :/
I'm not sure I'd recommend it, but it's at least possible to run JS/JVM code on mobile and interop with ObjC
CotEditor is the only decent starting point in the Swift land
Yeah even if I could patch the runtimes somehow, the performance and user experience will be very much degraded
Multiple buffers is smart (Emacs) Syntax highlighting... yeah that's an important one. Emacs also has the "undo tree" which is amazing and you can walk through code changes in a tree-like fashion. Directory/file viewer... Ability to know when a file is changed from the on-disk copy...
Darn, using the apple pencil would be pretty awesome. Are you sure there's no way to get it in Java land?
Yeah editing lisp code with Apple Pencil will feel really natural I think. A sneak peak of my pondering.
1š®The Apple Pencil experience is really smooth, Iām afraid it demands a native runtime for a highly quality experience.
fwiw, I was recently able to compile clojure with graalvm native image to run on my iPhone including evaling clojure code with sci.
for your lisp editor, how would you input code, normal keyboard or did you have something else in mind?
Yeah I did follow those conversations and Iām really excited about it. Embedding a Clojureish runtime in iOS is very exciting. I really hope it becomes a thing since I donāt want to compile Clojure code remotely from my iPad, if this editor ever takes any shape.
The lofty goal is to input everything from the Pencil. Apple has this scribble API for OCR which is good, but doesnāt recognise symbols yet but that could be tackled via the raw pencil input I think.
2š¤Ævery cool!
PSA: if you don't enjoy telling someone else what to type during Agile Story Grooming/Refinement, please vote for this jira issue https://jira.atlassian.com/browse/JRACLOUD-73885
if you are twitter famous pls retweet https://twitter.com/antonmos/status/1409553434487967748
deal breaker: there should never be a way of losing any significant amount of work, even if your power suddenly goes out (so you need some kind of incremental / auotmatic backup scheme). there are great editors that I would use except I refuse to use an editor that doesn't prevent losing my work.
1we shouldn't have to explicitly save our files for any reason other than trying out new code - everything else should be implicitly managed by the editor between explicit saves
That's a pretty cool idea