First of all, I'm forced to use LispWorks and I would like to know what compiler does it actually use and whether I can use it in CLI. Also in LispWorks there are methods like defsystem etc., are they somehow built in the environment or do they form a package I can actually load (for example) in sbcl REPL?
LispWorks is a commercial Common Lisp implementation that includes its own compiler, debugger, profiler, IDE &c &c.
It comes with its own defsystem macro (not method!) as well as adsf.
I strongly recommend that you consult the documentation that came with the software.
If one has a full LispWorks version (not the Personal Edition), then one can create a version which does not start the IDE by default:
See chapter 12.4.4 Saving a non-windowing image
Related
I've read many topics regarding this issue, but couldn't get it to an end. I want to be able to code in LISP on Mac, using Emacs and XLispStat.
So far, I've installed Emacs with HomeBrew but I got stuck when installing XLispStat. Can someone detail the steps for doing this? I'll appreciate!
P.S.: This is the required installation for Lisp. If there is something easier to achieve on Mac, I'll try that as well!
I posted a similar answer on this question. Short version: your options for an OS X Lisp environment are LispBox, LispWorks personal (crippleware warning) or Emacs+SLIME via quicklisp/ELPA.
Since your comments imply that you're casting a pretty wide net for workable Common Lisp tools, I'll also mention that CLISP seems to be supported via various OS X ports/package managers and has a fairly comfortable REPL (you can, of course get the same in SBCL with Linedit).
EDIT: As Rainer and Vsevolod mention below, Clozure and MCLIDE also exist. I've used neither myself, so I can't give you any details (though Clozure has been recommended to me on multiple occasions).
Oh, and is there a possibility to write the code is some normal text editor and compile it somehow in the terminal?
Not in the way that I think you mean, but yes, you can write a .lisp file with Sublime or whatever, then sbcl your-file-here.lisp. Note that sbcl your-file-here.lisp starts a running Lisp instance with a REPL, and incurs all the overhead that implies. If you're dead set against Emacs, what you could do is run a REPL separately from your project directory, then just (load "file-you-changed.lisp") or (ql:quickload :your-project-name) every so often.
xlispstat can be compiled on Mac OS 10.8 and works perfectly fine. It needs a couple of little edits for the nitpicking compiler but works perfectly with XQuartz. The people who are telling you to use other systems don't know how well integrated xlispstat is for people doing numerical work.
Is it possible to call a Common Lisp function in iOS?
If so, is it possible create it in a dynamic library?
It depends on what you mean by calling a CL function, but most likely ECL will be your shortest path. Start here, as there is a patch for ECL to better accommodate iOS: http://funcall.posterous.com/tag/iphone
ECL generates C code, so you should be in safe territory with Apple's shifting policies.
Have you tried MOCL?
According to the website "mocl is a highly optimizing CL implementation, delivering tight native code via LLVM/Clang".
Maybe you can create a dynamic library, though it is designed for use the other way around.
Clozure Common Lisp (CCL) runs in Linux on the ARM, and Gary Byers long ago made an experimental iPhone version, but it would only run on a jail-broken iPhone. The problem is that the CCL compiler writes executable code, but iOS out-of-the-box does not allow a writable page to be made executable, so you can't ever RUN that code.
We've had discussions about putting the code that ships with an iOS app be in a read-only code section, and adding a byte-code compiler, so that code created at run-time can be fairly quickly interpreted, but nobody has offered to fund that project, so it hasn't gotten done.
You might think that we could just interpret code created at run-time, but the current CCL "interpreter" compiles non-trivial code before executing it.
MOCL is probably your best option to write code callable from other apps, but that's only a guess, since I haven't used it.
You could use Gambit Scheme or Clozure Common Lisp, both are able to interface with Cocoa, the first because it generates C and the latter because there is a bridge from Clozure to Cocoa. Do a google search about it and you will find a few things.
You might want to keep an eye on this (new) project. It will be publicly available during October 2019: EQL5 iOS EQL5 iOS libs
There also exists Mobile Common Lisp1
Emacs is the IDE of choice for programming Erlang.
There are plenty of good modes (distel, erlware-mode, the default erlang mode,...), but what are your recommendations for setting up Emacs for professional Erlang development?
Set up erlang-mode as described in the README, and then activate Flymake:
(require 'erlang-flymake)
That gives you highlighting of warnings and errors as you type.
I'd recommend using erlang-mode from the latest Erlang/OTP release (R14A as I type this), regardless of what release you normally use, as it evolves quite rapidly and is now just as good as erlware-mode, IMHO.
If you're using Emacs 24 or later, I recommend installing erlang-mode from MELPA. The 'erlang' package tracks the 'maint' branch of the Erlang/OTP Git repository, so it is always reasonably up-to-date.
If you want more than erlang-mode offers, a possible alternative to Distel is EDTS, the Erlang Development Tool Suite. To quote the readme file:
EDTS is meant to be a able to replace Distel but only provides part of the most
commonly used of Distel's features, specifically the equivalents of
erl-find-module, erl-find-source-under-point, erl-who-calls and
erl-refactor-subfunction. As far as I know, those are the only Distel features
that 98% of people use, but if there is anything from Distel that you are
missing in EDTS, please let me know.
If you are using EDTS, please remove Distel from your configuration, since
running both can create some confusion.
Look onto this article about different packages for work with Erlang from Emacs. I personally use erlware-mode + distel
erlang.el (for indentation and font-locking) and Distel (debugger, M-. etc.) are essential. ESense, I've never used, and I've no idea what the erlware mode does. You may want to use some of the standard Emacs utilities (flymake, interface to version control, and so forth) when writing Erlang.
I've found erlang-mode ok but it doesn't support kerl (which is a useful thing, kinda like rvm for erlang, except it works).
So I started this:
https://github.com/nicferrier/emacs-erlang-extras
which supports multiple erlangs.
I'm intending that it will support rebar as well:
https://github.com/rebar/rebar/wiki/Getting-started
I found out ESense on emacswiki. Might worth a try.
I noticed how SLIME (lisp development package for Emacs) does not come with a frame-source-location function for CLISP, so you can't automagically jump to a source location when inside the debugger. Given that, I figured CLISP users must be using some other IDE (though I guess IDE is a little bit misleading here, maybe they're just using a different Emacs package).
So what IDE/Emacs package are CLISP programmers using?
I think Emacs and SLIME is still what those people use.
I'd like to take an existing application (written in OCaml) and create an Emacs "interface" for it (like, for example, the Emacs GDB mode). I would prefer to do this without writing a ton of Lisp code. In MVC terms, I'd like for the View to be Emacs, but for the Model and Controller to remain (primarily) OCaml.
Does anybody know of a way to write Emacs extensions in a language other than Lisp? This could either take the form of bindings to the Emacs extension API in some other language (e.g., making OCaml a first-class Emacs extension language) or an Emacs interaction mode where, for example, the extension has a pipe into which it can write Emacs Lisp expressions and read out result values.
http://www.emacswiki.org/cgi-bin/emacs-en?CategoryExtensionLanguage is a list of all non-Elisp extension languages you can use.
It does appear to be dynamic language centric.
http://common-lisp.net/project/slime/ is missing from that list, as it is not quite an extension language, but an Elisp-Common Lisp bridge. Its source code would show how to communicate back and forth over sockets.
A similar IDE for Erlang is Distel, at http://fresh.homeunix.net/~luke/distel/ (currently down) and https://github.com/massemanet/distel.
Good luck!
I don't know if this will work for your particular problem, but I have been doing something similar using the shell-command-to-string function:
(shell-command-to-string
"bash -c \"script-to-exec args\"")
So for example, we have existing scripts written in python which will mangle a file, so the above lets me invoke the script via emacs lisp.
A quick google search found this page describing a system to write extensions in Python, so it seems feasible to do what you want... you will just have to see if anyone has written a similar framework for OCaml.
Some Extension Api is now possible with the incoming emacs 25.1 and dynamic modules
A Library, emacs-ffi offer a foreign function interface based on libffi.
Check out complete documentation on the README.
Try PyMacs, which allows extending Emacs in Python.
edit: updated link.
From the statically typed languages side, there is something that looks quite performant and well featured for Haskell:
https://github.com/knupfer/haskell-emacs
there is also probably something useful for Scala to be reused from the Ensime project (has a bridge for both Emacs and Vim):
https://github.com/ensime/ensime-server
Furthermore, a quick google search revealed another potential candidate for extending Emacs with a classic FP language, OCaml; the project has a lot of .ml source files so there's got to be an Emacs-OCaml bridge somewhere:
https://github.com/the-lambda-church/merlin
There is no "Extension API". Emacs Lisp is way in there, and it ain't moving.
You can run Emacs commands from your other process. Have a look at Gnuserv.
There are plenty of applications where Emacs is the View for a Model/Controller in a separate process. The Emacs GDB interface is a good example. I'm not sure of a simpler example, maybe sql-postgresql?