Scaled is a modern programmer's text editor, built atop Java 9 and JavaFX 9, mostly written in Scala, and which is designed to be extensible "all the way down" like Emacs. Like Emacs, "all the way down" doesn't actually go all the way down, but it goes down a lot further than most other editors.
Scaled focuses on the text editing experience first, and IDE-like features second. This does not mean that the IDE features suck (indeed, a goal of Scaled is to push the frontiers of "intelligent" code editing), but rather that they are not "in your face" from a user experience standpoint. We start from the pristine calm of a colorized window of code, and tastefully grow from there.
Scaled is designed to be extensible in any JVM language. This is technically possible already, but will be substantially improved before I claim that anyone would actually want to do this. My goal is that a programmer using Scaled can comfortably extend the editor in their preferred JVM language with no more cognitive dissonance than they already endure when using a third party library written in Java. I may never reach perfection in that regard, but it will be a damned sight better than extending the editor in elisp (nothing against lisp, use Clojure if that's your bag).
Talk about it
A Scaled Google Group exists where questions, comments, suggestions and discussion of anything else related to Scaled or programmer's editors are welcome.
Kick the tires
If that hasn't scared you off, here's how to give it a whirl:
Scaled includes a package management system which is used to install Scaled itself as well as extension packages. The Scaled package manager (spam) is desgined to bootstrap itself from a single jar file which you can install in conjunction with a shell script or batch file.
java executable in your path must be from a Java 9 JDK installation, otherwise replace
java in the below scripts with the absolute path to
bin/java in a Java 9 JDK installation.
Unix / Mac OS X / Cygwin
Download scaled-pacman.jar and put it in your
Create a shell script
~/bin/spamwith the following contents:
java -jar `dirname $0`/scaled-pacman.jar "$@"
Note: Cygwin users can't use
dirname $0 so they'll have to replace that with the absolute path to
- Make the
chmod u+x ~/bin/spam
Note: if you're using OpenJDK on Linux, you need to be sure that you've also installed the OpenJFX package as Scaled uses JavaFX for its UI.
Download scaled-pacman.jar and put it into some directory that's in your shell search path.
Create a batch file
spam.batin the same directory as
scaled-pacman.jarwith the following contents:
set SCRIPT_DIR=%~dp0 java -jar "%SCRIPT_DIR%scaled-pacman.jar" %*
Use spam to install Scaled
Now that spam is installed, you can test that it's working by running:
and you should see this output:
Installed: pacman The Scaled Package Manager. Wakka wakka wakka.
Assuming you do, then you're ready to install Scaled. Do that like so:
spam install scaled
This will download and build all of the core packages that make up Scaled. Scaled packages are fetched directly from their DVCS source URLs and built locally during the installation process. Depending on the pre-existing state of your local Maven repository, this may involve downloading a bunch of existing jars, and it will involve compiling a bunch of code. It might take a minute or two on a reasonably speedy development machine.
Scaled will install itself into
~/.scaled on a non-Mac, and
~/Library/Application Support/Scaled on a Mac. Let's call that directory
SCALED_HOME. You can invoke Scaled via
spam, but it's cumbersome, instead symlink
SCALED_HOME/Packages/scaled/bin/scaled into your
~/bin directory (or wherever you like to put things so that they are on your shell path), and
then invoke Scaled via
Windows users can link (or copy)
SCALED_HOME\Packages\scaled\bin\scaled.bat somewhere such that
it's on their path.
By default, Scaled comes only with basic text editing capabilities. To properly Feel the Magic™, you will need to install some packages. You can list the available packages via:
spam list --all
If you are a Java developer, you'll probably want to:
spam install java-mode spam install maven-project spam install xml-mode
There is very rudimentary Gradle integration via
gradle-project but keep your expectations low.
Scaled also has LSP integration. If you have Eclipse metadata in your project, the Eclipse language server will be started automatically.
Scaled also includes basic integration with JUnit, allowing you to run tests directly from within
the editor and see results.
C-c C-t C-a runs all the tests for the project and there are other
bindings to run just the tests in the current file, just the test function under the point, or to
re-run the last executed test.
If you like the Scala, be sure to:
spam install scala-mode
Presently Scaled's integration with Maven projects is decent and its integration with SBT projects
leans heavily on the use of Ensime and its SBT integration. Be sure to generate a
before running Scaled in an SBT project.
When the Ensime language server is working more reliably, its language server will automatically be
started when an
.ensime file is found. In the meanwhile, one can manually set up the old
dragos:ensime-lsp language server
This includes basic integration with the Flow type checker.
And so on
There are myriad other very basic language modes with more or less (mostly less) integration with
those language's tools:
At the moment Scaled's "UI" follows Emacs where that makes sense (pretty much all of the basic
editing key bindings). Extensions like
project-mode introduce new interactions and I'm not making
an effort to model those on the myriad hodge-podge Emacs IDE-like extensions that exist, I'm just
trying to come up with sensible bindings.
At any time, you can invoke
M-x describe-mode (or
C-h m) to see all of the key bindings and
config vars for the the active major and minor modes. You can cross-reference that with the
Emacs reference card to see basic editing commands organized more usefully than alphabetic order.
Chances are, Scaled does not currently solve all of your development needs and make your favorite kind of toast. If you find that the fires in your belly are stoked by the idea of an Emacs-like extensible editor built atop the JVM, then perhaps you would like to extend Scaled such that it does support your desired toast-making capabilities. This is becoming a less crazy prospect day by day as the Scaled core stabilizes and the facilities for developing Scaled improve.
Because Scaled checks itself and all of its extensions out directly from source, you can simply
start hacking on the code that is checked out in
SCALED_HOME/Packages. This is not wildly
different than how I develop Scaled. I actually have the packages checked out elsewhere and symlink
SCALED_HOME/Packages, but that's mainly so that I can arrange the numerous Scaled
subprojects into a slightly less flat directory structure.
I'll eventually add support to the Scaled Package Manager to make it easier to maintain a "working"
Scaled installation in the standard location and a "development" Scaled installation elsewhere
which you hack on, run when testing, and can break without fear of hosing your development setup.
That's even theoretically possible right now by running
spam -Dscaled.meta=somedir (or
scaled -Dscaled.meta=somedir as -D args are passed through to
spam) but I'd like to make it
There's not much documentation on Scaled's internals yet, but if more than zero people turn up and want to help, then I'll gladly move the writing of said documentation up my priority list. The main ways to extend scaled are described below.
Scaled extensions come in three main flavors:
- services: programmatic services which provide functionality to other services and to modes
- plugins: services can define plugin APIs so that one package can define a service and other packages can extend it
- modes: major and minor editing modes (ala Emacs), which provide editing smarts specific to a particular programming language or activity
An example of all of these flavors working in harmony is the
project-service package which
provides a framework for grokking projects. Project support comes in three parts:
ProjectServiceis a service that a major mode can inject to gain access to "project services" (e.g. enumerate all files in the project, rebuild the project)
ProjectFinderis a plugin used by the project service to allow other packages to provide code that identifies a project based on what it sees on the file system (a
build.sbtfile, etc.) and provide code for operating on projects of that kind
ProjectModeis a minor mode which is automatically activated for any mode which is tagged with
project; the project minor mode adds key bindings for things like recompiling the project and annotating the appropriate buffers with warnings/errors
Most packages are simpler than the project package. They just export a major mode or two
java-mode for example), or just export a plugin for another service
maven-project for example)
Anyone can write a Scaled extension, but all currently known Scaled extensions live in the Github Scaled project.
Scaled is released under the New BSD License. The most recent version of the code is available at https://github.com/scaled/scaled