I'd like to run Scheme under Jupyter. The traditional cell magic approach, which works in other cases (using %%bash, %%latex or %%ruby), is not available.
Note: I am not interested in Scheme Calypso, which does not have the whole Scheme functionality. I just want to run my Scheme installation at /usr/bin/scheme.
You can't. You can't just run an arbitrary installation in Jupyter - you need a dedicated kernel. You've already ruled out the existing Scheme kernel so I don't know what you're expecting. Perhaps ou can write your own Scheme kernel?
Calysto Scheme has much of a full Scheme language specification. You can try it live here: https://jupyter.org/try
If you find it missing something that you would really like to have, please let us know!
Related
First I'll show you an example of what I am talking about: GUI Example
I've been studying Lua for around a week now, and I'm really curious of how I would do this. Basically (for now, and learning purposes), I just want to make a GUI with 2 buttons, 1 to start the specified (.exe), and one to exit the GUI.
Is this possible? How would I go about doing this? Any information would be great!
I believe you may want to take a look:
http://lua-users.org/wiki/GraphicalUserInterfaceToolkits
If you want something well know and tested I would go to Qt, if something light: FLTK.
If you are an absolute beginner, i.e. you don't have any programming experience in other programming languages, I advice you to learn Lua very well without trying to mess with GUI programming, which is inherently much harder.
When you will have a good understanding of Lua, then go for a GUI toolkit for Lua. I use wxLua so I can only give you some hints on that.
Since it is not a "native" Lua toolkit, but it is a "binding" to a well-known cross-platform GUI library (wxWidgets) you must study both the wxLua documentation and wxWidgets manual (at least to some degree).
wxLua binary distribution comes with everything needed to use it (you don't even need a separate Lua interpreter, it has its own) and contains a good number of example applications.
The following script is a trivial approximation of what you want to do, but (I repeat myself) you should really learn the basics of Lua before attempting GUI programming.
local wx = require 'wx'
local PATH_TO_APPLICATION = [[notepad.exe]] -- Windows assumed for sake of exemplification
local ans = wx.wxMessageBox( "Should the application be started?", "Hi there!",
wx.wxOK + wx.wxCANCEL + wx.wxICON_QUESTION )
if ans == wx.wxOK then
wx.wxExecute( PATH_TO_APPLICATION )
end
To run the previous script you must be sure that wxLua is installed correctly in your interpreter search path. Otherwise you must use the wxlua.exe interpreter that comes with the distribution.
Note also that wxLua interpreter (latest wxLua stable release) runs with a version of Lua 5.1, so try not to use features of Lua 5.2 in your scripts. Basic Lua syntax and semantics is almost the same, but there are some slight differences and Lua 5.2 has a couple of added features. So be careful with your learning path.
IUP should be the easiest way to create a GUI with Lua. However you will meet a brick wall if you try to install IUP on Linux. You have to hope someone has pre-installed it or someone has pre-written an install package for your version of Linux. If you want other people to be able to run your code later it will be virtually impossible to set things up in reasonable way. That is really an error by the Lua/Iup team because I have no trouble in using Iup from the C programming language and it seems to be widely compatible with many versions of Linux. It is the opposite of the usual situation where it is very easy to set up a scripting language and difficult to set up a low level language like C.
Have you checked wxLua ? This is the only desktop gui framework I am aware of for Lua.
Another example is IUP:
http://www.tecgraf.puc-rio.br/iup/
It is supported for Microsoft Windows and Unix
I have been trying to find an environment that does not involve installing anything else on my mac for Lisp, as I will not be using it after I get the homework done (who know if I continue using it). I have tried to look but I can't find anything. Anybody know if it does have it, and how to use it within Emacs?
You have a few options for one-click Lisp environments.
If you prefer an Emacs-based environment, check out LispBox. This actually installs a separate instance of Emacs, afaik, so you probably won't have your existing Emacs settings with it.
If you want to use your existing Emacs, SLIME is available both through quicklisp (which you really should be using) or through ELPA.
If you're ok with not having an Emacs environment, and you're not going to be using the language for long, look into LispWorks personal, which has a one-click environment installer in OS X.
If you were actually asking about Scheme (or could go for either Scheme or Common Lisp), take a look at Racket (not technically a Scheme, it actually has a lot of additional features, but they do support R5RS and have a fairly short list of unsupported R6RS features).
Emacs Lisp is rather different from regular Lisp, so it's probably not directly useful for classes or self-study if your target is something like Scheme or Common Lisp. But yes, Emacs has its own Lisp interpreter (or rather, is its own Lisp interpreter). You might want to read up on the differences between Emacs elisp and other dialects / variants to determine whether it might suit your needs.
Clozure CL is a available for free from the Mac App Store
http://itunes.apple.com/us/app/clozure-cl/id489900618?ls=1&mt=12
Have you checked Ready Lisp ?
Also have a look at here.
For some reason I'm having trouble running MIT scheme. On my Dell, which runs Windows Vista, I can't even open MIT scheme; I get a message: "Heap Size exceeded", or something like that. I can run it fine on my Mac, but Edwin is a bit confusing. Does anyone know how to fix my problem on Windows, and where I can find some good Edwin tutorials? Thanks!
Edwin is a variant of Emacs which uses Scheme instead of Emacs Lisp. Take a look at the relevant sections of the MIT Scheme manual:
http://groups.csail.mit.edu/mac/ftpdir/scheme-7.4/doc-html/user_8.html#SEC55
Not sure why MIT Scheme wouldn't run on Windows, however, if you installed it on OS X, try just running mit-scheme from Terminal.app. This should just give you a Scheme REPL. You can enter Scheme expressions etc, and also load Scheme source files with (load "file.scm"). Finally, you can also load files from the command line with mit-scheme --load file.scm.
If all that doesn't work, are you sure you need MIT Scheme? You could try PLT Scheme/Racket, which would let you run Scheme code, you might have better luck in Windows. Not sure about that though.
I would like to create a terminal based installer/wizard.
Ideally, it'd be like the Ubuntu server installer, or the Arch Linux installer - a ncurses (?) heavy GUI with lots of form and arrow key goodness.
Second best would be a simpler question/answer type thing, similar to the "adduser" command prompting for password, username, etc.
I am Ruby biased, and would prefer a scripting language (not C), but I'm open to anything. It will only run on Ubuntu server, if that helps.
What are my options?
I'm not certain what you're asking. If you're looking for an implementation tool, you could look at urwid, which is a Python-based GUI toolkit library. It lets you write programs using GTK-style widgets and event interfaces for a text-based interface. If you're a decent scripter, it shouldn't be too hard to start from there and write the code to drive an installation process.
InstallJammer can do what you want in the second form. No ncurses interface to speak of though. 0-] It's written in Tcl/Tk, so it meets your scripting requirement though obviously not in your language of choice. We all have our language of choice, I suppose. 0-]
It would be easier to answer if you specified what you're trying to do. If you're installing something, it might make sense to just create a debian package and use install time configuration options available via debhelper.
If bash or shell scripting is okay, I'd suggest looking at package "dialog". Just put "dialog" as pre-depends for your package and you can use dialog features for your deb installer.
Another possibility could be the "pdmenu" package (origin: http://kitenet.net/~joey/code/pdmenu/).
I've gone through the academic Scheme stuff (read SICP, The Little Schemer, The Seasoned Schemer, TSPL) and been playing with Scheme as a toy for a while.
But I want to get practical.
Today I needed to write a shell script to do some batch file processing, and thought "why not do it in Scheme?". I did, and it was a joy.
Now I'm forced to wonder what the best implementation is for shell script type stuff.
I know all implementations differ in terms of what they implement beyond R5RS. (Basically, they differ in all the useful and practical extensions you'd want in a scripting language).
So I'd like to pick one implementation and stick to it. I'm looking for something that:
Is cross platform (Linux, OS X, Windows).
Has extensions that are useful in day-to-day shell scripting, and those extensions are part of the base install.
Is easy to install. (e.g. there are a number of pre-built binaries, and/or it is a standard package on many distros.)
Is actively developed, with an active community.
Has Unicode support.
I've been using Gambit so far. It seems to satisfy the above constraints. PLT seems like overkill. Wondering about Guile, MIT/GNU, etc.
PLT Scheme meets all of your criteria. Since it looks like you know that already, you should to use the MzScheme package. MzScheme is the runtime on top of which all of PLT is built.
If you were to download the full PLT Scheme install it would seem large as it includes a lot of documentation and an IDE in addition to the runtime.
Have you heard of scsh? I haven't used it, but it sounds a lot like what you want.
I recommend Gauche, which is:
Running on Linux, OS X, Windows w/
Cygwin and some other UNIX-like
platforms,
The base install contains
POSIX-compliant system libraries and
useful modules such as
network protocols, file system,
DBM, multithreading, etc...
Several package system such as MacPorts, apt-get, yum are available
(or just say configure, make and
make install),
There are active English and Japanese mailing list,
Supports UTF-8 as an internal encoding.