The real benefit of a REPL isn't a plain REPL on its own. It's being able to work on top of a partial program (even one that blows up somewhere on startup), akin to a powerful debugger (but not for debugging per se). If I run python -i myscript.py
I can immediately start running and introspecting my values, yet the basic script is still very much inside my editor.
In fact, I've moved the REPL into my editor to get something akin to Light Table.
<uj>
It's not as insane as you'd think. Your Firefox example is spot on, because it's basically using Javascript and a HTML-like language for the UI. UI toolkits have been moving that way for years, too. Qt has the Javascript-driven QML, and I believe Gtk has something similar as well.
It's not a browser, but Light Table takes advantage of Electron in the same sort of way. If you're editing something like an HTML file, you can split the view and show the rendered HTML in the second frame, with on-the-fly updates of changes.
It's a sad, fucked up situation, but the guy being mocked has a point, and the title here is a major misrepresentation of what was said. Especially considering how insanely huge and complex a browser is, if a guy is having to ask online how to get started, he's clearly not prepared to actually start writing all the shit from scratch, so it was decent advice given the context.
</uj>
Clojure is definitely a good Lisp to learn. It's easier to get into as it has a bit more syntax than traditional Lisps such as CL and Scheme. Clojure is also more focused on using the functional style and it's backed by immutable data structures, so it's a nice fit for anything involving multithreading. Running on the JVM makes it widely applicable in production and leverages a lot of the existing work that went into the platform. It's also the most widely used one for new development, so you can actually get a job working with it relatively easily.
I would recommend trying Light Table for trying it out. It requires no setup and you can play with the REPL out of the box. I wrote a starter guide a little while back that I hear is helpful.
One thing to note is that Emacs is in no way a requirement for working with Clojure. I've been developing Clojure professionally for 5 years now and I've never used Emacs for that. I'm currently using Cursive, but I found Counterclockwise to be a very competent Clojure editor as well. For smaller projects Light Table is a fine choice, it's also by far the easiest Clojure editor to get into.
Emacs is a great editor, and it's very powerful. However, it's also fairly archaic in a lot of ways and it has a very steep learning curve. I would not recommend learning it alongside learning Clojure.
> It is built with ClojureScript (and 'transpiled' to Javascript on the fly) for the purposes of being run inside a Chromium-V8 shell (I think node.js/CEF rather than today's more popular Electron).
Nope, it got ported to Electron for version 0.8, after the person that kickstarted the project abandoned it and turned it over to the community.
> it remains useful but somewhat of a museum piece. It receives occasionally updates to keep it operational, but it's been awhile since I've seen any big feature pushes.
The core maintainers seem to still be trying to make real changes to it, they published a roadmap at the beginning of the year that indicates they're trying to clean up and improve the documentation and core of the editor to make it better to maintain long-term. Sure, it's not glamourous, but that's the kind of work that needs doing if there's any chance of a project lasting long-term.
Github The project is inspired by Light Table IDE. There is no need to reinvent the wheel. I wish Light Table just wrote some emacs plugins instead.
Live preview is a rare feature because it's actually pretty hard to implement in a lot of contexts. If you're writing HTML and CSS, it's not too bad: the page just needs to reload every time you save. But if you're writing Python code, for instance, that's harder: your code may depend on a bunch of other code running and being set up in order to work properly, and your editor probably doesn't know enough about the project to show you a meaningful preview as you work.
It's not impossible, though, and there are people actively working on it. In particular, you might check out Light Table, an open source IDE that makes heavy use of live preview. I haven't used it much -- last I tried it it was still very beta, and Sublime was more useful to me -- but it's an interesting project.
It's still having commits made as of a few months ago so rumours of its demise may have been greatly exaggerated.
The bit about the original author abandoning ship to work on something else is true, but it's open source and others have been keeping it going, including moving it to 0.8.0 and Electron instead of whatever it was Granger used originally. You have to keep in mind, when Light Table gets discussed, some people are going to be unreasonably bitter because it was a Kickstarter project, and many people that backed it are probably pissed that Granger made his money, released the project, and then left it to the community to deal with after.
If nothing else, it's worth trying out for the InstaREPL. It's a cool feature that used to be built-in, but got moved to a plugin, so you'll have to install it using the plugin manager now. Still, it's a really slick way to work with Clojure code, because it does live evaluation and shows the results in-line as you enter expressions. It's also something that I haven't really seen in Clojure plugins (though I haven't tried Cursive, so don't know about that one.)
pelo mesmo motivo que operadores de banco usam software estilo linha de comando até hoje, você pode passar um monte de comandos sem ter que esperar a resposta da interface, com o tempo você vai aprendendo mais a ferramenta e a produtividade aumenta(e também a satisfação da pessoa que usa por estar usando/aprendendo uma ferramenta mais sofisticada), é uma forma superior de operar. Além disso o vim é muito extensível, eu vejo gente mudando de editor por causa de uma featurezinha aqui ou ali, o vim tem todas as features que vc imaginar(e.g.: pra todas as linguagens, pra todos os frameworks, pra todos os workflows) e se não tiver você põe.
O VIM vai durar até o dia que uma ferramenta completamente nova apareça que faça os programadores experientes mais produtivos do que eles são com VIM e isso é difícil, a tentativa mais recente que sei é o LightTable(http://lighttable.com/) e infelizmente está parecendo que ele não vai conseguir. Por outro lado... o IDEA tem umas features realmente boas e inovadoras, é muito polido e é até bonito, além de ter um modo VIM ótimo, isso me tirou um pouco do 'purismo VIM'.
You first have to load the namespace using use
or require
, e.g:
lein new aproject
Generating a project called aproject based on the 'default' template.
The default template is intended for library projects, not applications.
To see other templates (app, plugin, etc), try lein help new
.
~/tmp/> cd aproject/
~/tmp/aproject> lein repl
nREPL server started on port 61427 on host 127.0.0.1 - nrepl://127.0.0.1:61427
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (use 'aproject.core) nil user=> (foo "Test") Test Hello, World! nil user=>
However, normally the way you'd work is to either open the repl from the editor or connect an editor to it. The simplest example would be with Light Table where you open up your aproject
folder in LT, then open a namespace from it and hit ctrl+enter
, or cmd+enter
on os x, at that point the editor will connect to the REPL and any functions you write you can send there for evaluation. The REPL keeps the state of the application and the editor knows what namespace you're working in. The REPL becomes an integral part of the development process as you can run any code you write in it directly.
I know of several people who use Emacs to do most of their day-to-day work in software development, taking notes, calender, IRC chat rooms, even email. Emacs is based on a Lisp dialect called Emacs Lisp (a.k.a ELisp).
I think Scheme and derivatives (including /r/Clojure and Racket) are a little more modern with some more advanced features and syntax, as compared to Lisp, like an easier-to-type object notation, interfaces, and namespaces.
You could think of modern IDEs like LightTable and NightCode as kind of modern, Clojure-based replacements for Emacs. And, of course, Racket has it's own IDE as well.
I do all my personal projects in /r/Haskell, which is a little like Racket but with infix operators so you don't need to write parentheses all over the place, it has a "do" syntax for defining functions that feel very similar to languages like Python, and also it has (in my opinion) the worlds most advance static type checker.
thanks :)
And yes, more of a REPL / scratchpad. Too bad you can't change post titles.
I was partly inspired by Bret Victor's posts, he had some really cool ideas on his blog. My main inspiration though was lighttable, though I wouldn't be suprised if that also inspired by Bret Victor.
So far everyone has mentioned side-effects as a concern. I'll add in the ability to stop and restart the real-time evaluation next release.
I saw your comment about problems with Clojure modes in editors. Have you tried Light Table yet? I used it for a while; it's made with Clojure(script) so it has pretty good interaction with Clojure. The impression I got when using it was "this is a modern emacs", and I mean that in a good way. I eventually quit using it for cider+emacs, but only because they quit doing 32-bit builds at a time when my Debian install was still 32-bit.
Configuration isn't the most user friendly — you edit EDN structures directly — but that shouldn't be a deal-breaker since 1. you know Clojure and 2. VSCode's "edit JSON structures" configuration is no better.
The most prominent entity using Elm right now I can think of are the guys of Noredink, I believe they even hired the Elm's creator this week to work with them. On the Clojure side there are a ton of projects, The firsts that comes to my mind are LightTable since I use it and Datomic.
Both are great choices but Clojure is certainly more stable and can be used in the client and the server. At the end of the day everything comes down preference. If you prefer a wonderful static type system go for Elm and if you prefer a more dynamic workflow (in every sense of the word) Clojure is your best bet.
You can use the Ultra plugin to add stuff like REPL colors. However, practically nobody uses a terminal REPL to actually work with Clojure. Any Clojure editor will allow you to connect to the REPL and run code from the editor in it. I recommend trying Light Table out. All you have to do is open a Leiningen project in it, then open a file and hit <ctrl>+<enter>
on win/linux or <cmd>+<enter>
on os x and it'll connect to the REPL and let you evaluate code. You can also start an instaREPL without using any project by doing <ctrl>+<space>
and typing instarepl+<enter>
.
This looks like a great project! It reminds me a lot of the Light Table project but for .NET. :)
Shame the license is subscription-only though. I prefer the option to buy a permanent license for the current version and only pay to upgrade when I see it as beneficial.
Once there's a trial version though, I'll give it a try. :)
I wrote an intro guide people seem to like too and there's another more indepth one I recommend. Light Table is a good way to play around with it as well, you can just open up a REPL with it and start playing with the code. :)
I would of course need to test it out to have any proper critique, and I'm not criticizing your product specifically. The template stuff really looks like a great thing (even though I've just seen the very surface of it), and I totally trust your experience in how to handle stuff in a big project environment.
It was mostly a random thought I blurted out because I've started doing node based tools for different things myself, and I always get a feeling that I'm just making something that's more cumbersome and less descriptive than... plain text basically. Might be that I'm doing it wrong though. :D
If I were to brainstorm on alternative ways, I would like to experiment with some simple DSL that can be transformed with templates (good idea), coupled with a heavily specific editor that adds the good things from visual programming like preview of intermediate values and specialized input widgets (color pickers etc), while still retaining the power of text editing (compact, fast). Not sure exactly how it would turn out, but it feels like Light Table is aiming to be something like that. Not sure, haven't actually tried it.
Just thinking out loud. Or well, in text. :)
We could use Stompz but that probably wouldn't be good enough for drawing but would be good enough for control of colours, brushes etc
We could go the old school route of something similar to Logo software by Harvard Associates Inc
That program used a turtle and you inputted the angle and the distance and it drew the lines.
We could use Stompz where one foot controls drawing aka movement and the other controls the angle by pivoting your foot.
What you're talking about is called a structure editor:
http://en.wikipedia.org/wiki/Structure_editor
As that page indicates, there is at least one structure editor that supports Java:
http://www.alice.org/index.php
That one is designed for children. There are also structure editors designed for professional programmers, which is probably what you would want. However, I'm not aware (off-hand) of any particular one that supports Java. (I don't use Java, so don't take that to mean none exists.) There is LightTable -- which is designed for professionals, and looks quite interesting -- but it supports Clojure (among other languages), not actual Java.
However, I think you are probably fooling yourself if you think that this kind of editor can help you with "the nuances of logic." All that they do is prevent syntax errors. And there are a lot of IDEs that can do the same thing just by highlighting syntax errors (like spellcheck almost).
Personally, I like the structure editor idea in the abstract, but I've never found one that I think is actually worth using. The structure editor idea has existed for decades and it never really took off, and there is probably a good reason for that. Not that it is a bad idea, but it's very hard to make an editor like this that won't slow down an experienced user. There are extremely subtle UI issues that I don't think have been solved yet (although people are always trying).
So, I suggest you also look into IDEs that might be able to help you through any syntax issues. Either way, don't expect too much. The real problems you have are probably conceptual and will simply require you to adapt your brain to the code rather than magically do it the other way around.
Light Table had a similar approach, although it was mostly clojure-only: https://www.youtube.com/watch?v=H58-n7uldoU
It's a shame that it seems to be abandoned nowadays.
There is an entire IDE developed around this concept. Over time they ended up dumping the floating fragment editor concept, but it was very much part of the early prototypes.
Pfft. If anything you should probably be getting mad at me for comparing vim to vscode >:)
Joking aside, vscode's pretty good for what it is, even if I don't particularly like the "yet another GUI app made by bundling an entire browser + webserver" architecture of it. For both good and ill, it's what you'd get if you described the design of emacs to a modern-day webshit and asked them to build it: interesting platform build on a shitty architecture.
Light Table was another promising editor of that style, using ClojureScript to build an editor with some cool features, but the dev got his funding money, then got bored and took it to do other stuff instead (which he also abandoned after getting people's money and getting bored) so it basically died :/
Anyway, the point of that line was that most text editors do more than just editing text, so comparing nano to a completely different class of editor is an apples-to-oranges thing.
uj: I'd probably use VS Code more if I didn't already use emacs and have it set up how I like it. I liked Light Table more than either but it crashed and burned after the creator took the backer money and bailed to make some goofy literate programming environment+language called Eve that's probably full of PCJ material for anybody interested in looking for it. Example from the Eve page's paragraph headings: "An IDE like Medium, not Vim" (Edit: Looks like that got abandoned too.)
The idea of skipping a menu and instead using the command palette is interesting and vaguely emacs-like in concept, but the keybindings for it aren't very convenient. Some editors like Light Table use ctrl+space instead, which I've found to be a good choice for it, especially if you swap ctrl and capslock (search).
Have you ever written any webpages from scratch? I would suggest visiting one of the current pages and examining them with developers options enabled or opening the page in an editor such as LightTable
> Also, I am a little concerned about using an IDE like IntelliJ, which I like, but seems overwhelmingly complicated for a youngster. It's practically overwhelmingly complicated for me.
You'd probably be better off with Nightcode, which is a more beginner-oriented IDE focused on Clojure and ClojureScript. It helps deal with leiningen and boot, and provides easy access to a Clojure cheatsheet built-in. Sort of tries to be the DrRacket of Clojure, where you get something that's "IDE lite" — less powerful, but easier to get started with compared to things like IntelliJ or emacs+CIDER.
Or maybe Nightlight, from the same guy. You add it as a project dependency with Leiningen, and you get an editor/IDE that's part of the Clojure project itself.
I also think Light Table is a pretty cool Clojure editor thanks to its InstaREPL, but last time I used it it had a lot of warts that make it harder to recommend. Might be worth a look, though.
I use Clojure and Atom with proto-repl or Light Table are the easiest way to get up and running with it. I gave a talk last year where I illustrate the workflow live coding a small web app.
I probably won't follow this project because from my point of view it is pointless to make an emacs clone. GNU Emacs is the best at being Emacs, reproducing its problems is not interesting. You should improve it to make something better (even if it is incompatible) I haven't actually tried it but I think Light Table is an interesting take on that.
You could argue that Javadoc comments (and their derivatives) are a specific kind of annotation designed to help IDEs show better code completion / documentation tooltips. Javadoc syntax is built into the lanugage spec I believe.
Similarly, there have been various 'NotNull' IDE-specific annotations (which has now been standardised into part of the language).
Many IDEs support their own kinds of annotations, or sometimes push formatting rules into a separate document. Your playing suits example could probably be done in Visual Studio as a custom debugging expansion for example.
Ultimately though I think it's because the trend has been to skip your step of 'source parsing hints' and try and make the language spec easier to parse. Compare the comparative difficulty in trying to parse C++ (hard!) with trying to parse a more modern language like C#. At the same time, concept that were 'emulated' (eg. a series of constants for an enumeration in C) become explicitly supported (enums in C++/Java/C#). Again, your playing card example could probably be done in Java with a javadoc'd enum, something like Eclipse probably gets you 90% of the way there, and the last 10% hasn't been deemed worth it.
Also, check out Lighttable, which is an IDE which picks up similar ideas (like having inline-colour picker for code like 'new Color(12, 49, 128)'
Yeah I'm not trying to crap on AS, just wanted to share some reasons why one would use a different environment. My first bullet is the killer for me, there is no way I could have one context for Android and another for web development.
The layout editor seems very slick from what I've played with it. Writing XML layouts is probably my least favorite part of Android dev. Maybe I need to use it in a real app to see where it falls short.
The terminal (or vim really) does have auto completion, code inspection and easy refactoring actually. I always have a browser window open for documentation and think that works significantly better then an IDE. I'm not sold on the ideas behind Light Table.
To each their own for sure, regardless of whether I use it or not I think AS is a great addition to Android.
Did you consider Light Table for your IDE?
I've used it a bit on Gaggysnaggles, and while it has its rough points, if you can get the fancy features to work. I could sortof get them to work for gaggysnaggles, but actually doing it would've required refactoring parts of the code that I didn't want to refactor (anonymous functions seem to be hard for light table to reach into, for example). And it integrates with google chrome, which just seems like a much more desirable choice than IE.
'Course, I'm using Ubuntu, so, I haven't actually tried Visual Studios for web development stuff.
Yeah, coming from JS to Java is a big transition, lots of structure and rules. In a way it takes focus away from building features to structure and architecture.
Something along the lines of light table is a potential new way of building. Microsoft has been working towards a similar concept for Visual Studio.
Chris Granger is a huge dreamer, but I doubt he can do what he can do the things he promises often. I mean, LightTable is still just a shell of what the original promise of it was: http://lighttable.com/