10

I'm looking for a compiler or interpreter for a language with basic math support and File IO which can be executed directly from a memorystick in either Linux or Windows. Built in functionality for basic datastructures and sorting/searching would be a plus.

(I've read about movable python, but it only supports windows)

Thank you

tovare
  • 4,027
  • 5
  • 29
  • 30

11 Answers11

8

Not sure what are the issues there for the other languages, but I am pretty sure that Lua will work fine on such environment.

It is perfect for your requirements: basic I/O, math functions, excellent data structures (all based on numeric and associative array, with any kind of key/values, allowing the most complex operations).
Bonus: very simple to learn (for the bases, at least), readable, and powerful when you start to dig. And it starts to have a number of useful libraries, sockets, regexes and parsers, GUI, etc.

It is just a single binary file, no install at all, no registry access, no file access (beyond reading the binary and script!) if not requested, totally transparent: it is often used in embedded system, often memory constrained, on Roms, etc.

PhiLho
  • 40,535
  • 6
  • 96
  • 134
  • Thanks, i just happened to read about Lua in another question about game-programming, so I was just reading about it. Does it install on a USB-stick. – tovare Dec 20 '08 at 21:34
  • I just expanded my answer. I didn't tried to install it on a stick, but I see no issue there. It costs nothing to try (Lua is small!). – PhiLho Dec 20 '08 at 21:38
2

The Java JDK easily fits on a stick, and does not require installation; You can install it to a PC first and then just copy the install directory to the stick. I presume you can do the same for the Linux JDK.

And there's a ton of good text editors that don't require installation.

Lawrence Dol
  • 63,018
  • 25
  • 139
  • 189
  • Thanks, I didn't know this. I though java required registry access. – tovare Dec 20 '08 at 22:32
  • Yeah, but I wanna see you develop Java in a simple text editor... Of course you can use eclipse too, but JRE for win and linux + eclipse for win and linux is about 1GB, and a bit clumsy... – abyx Dec 21 '08 at 08:17
  • @abyx: Actually, I *do* use a simple text editor (TextPad) to develop Java. – Lawrence Dol Dec 22 '08 at 05:33
  • You can use eclipse in a portable way, look here: http://portableapps.com/node/929 – Xn0vv3r Jan 15 '09 at 09:13
2

There is a python distribution called Movable Python which is designed to do exactly that. It might do what you want. Also, MinGW/MSYS will run on Windows with no registry entries or other installation beyond placing the files in a directory tree - all you need to do is set up the relevant directories in the path, which can be done in a batch file.

ConcernedOfTunbridgeWells
  • 64,444
  • 15
  • 143
  • 197
1

I'm way late for this party, but I thought I'd weigh in anyway.

I currently have a Windows-usable USB stick with the following installed on it (for Windows):

Languages

  • Java
  • Erlang
  • Fantom
  • Groovy
  • Haskell
  • jacl (JVM-based Tcl)
  • JavaFX
  • JRuby (JVM-based Ruby)
  • Jython (JVM-based Python)
  • NASM
  • nice
  • pnuts
  • Rexx
  • Scala
  • SISC (JVM-based Scheme)
  • Sleep
  • Tcl
  • Prolog
  • gawk (via GnuWin32 and MinGW/MSys)
  • jawk (JVM-based AWK)
  • ANTLR
  • Clojure
  • JBasic (JVM-based BASIC)
  • Tuprolog (JVM-based Prolog)
  • Rhino (JVM-based Javascript)
  • YASM
  • Lua
  • Kahlua (JVM-based Lua)
  • C (via GnuWin32 and MinGW/MSys)
  • C++ (via GnuWin32 and MinGW/MSys)
  • Fortran77 (via GnuWin32 and MinGW/MSys)
  • Ada (via GnuWin32 and MinGW/MSys)

Programming Tools

  • jEdit (JVM-based programmer's editor)
  • Ant (JVM-based build tool)
  • Maven 2 (JVM-based build tool)
  • vi (via GnuWin32 and MinGW/MSys)
  • Vim
  • CMake
  • gmake (via GnuWin32 and MinGW/MSys)
  • Leiningen
  • Subversion
  • Fossil
  • ANTLRworks
  • ctags/etags

Geek Toys

  • All SIMH emulators, with networking if available
  • Several operating systems, utilities, etc. for same

And a cast of dozens in key libraries, plus the Geronimo application server.

Yes, this is a single USB stick, and I probably missed an item here or there while making this list. It's amazing what you can run off of a USB stick these days.

JUST MY correct OPINION
  • 35,674
  • 17
  • 77
  • 99
  • What's the size of all of this ? – Leonel Sep 22 '10 at 12:35
  • @Leonel: Since I posted that I've added Factor, Yap, Hudson and some SQLite tools to the mix, so my current mix of languages, development tools and geek toys weighs in at just under 4GB on disk. (Actual data size is closer to 3.2GB, but slack space accounts for a lot there.) – JUST MY correct OPINION Sep 22 '10 at 13:34
1

Not sure if it still applies to current versions, but I have an ancient perl.exe (version 5.001, from 1994 or 1995) that still works perfectly fine as a no-installation single executable.

Arnout
  • 2,780
  • 14
  • 12
1

If you can tolerate TCL, it's hard to beat a tclkit

1

TCC (the Tiny C Compiler) is a full implementation of C in a really small package. You can even write shell scripts in C:

#!/usr/local/bin/tcc -run
#include <stdio.h>

int main() 
{
    printf("Hello World\n");
    return 0;
}

TCC is available for any Unix-like platform, and also for Windows.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
1

I've done exactly that with Ruby. Worked well.

Jim Blizard
  • 4,255
  • 28
  • 37
0

You could use DevCpp, it comes with Mingw 3.x or CodeLite (Mingw 4.x) for C/C++. For Pascal you can use DevPas, for Python web development try InstantDjango or better yet Web2py (very nice indeed!), for Ruby you have InstanRails, for Perl you got a complete enviroment (even a C compiler!) with StrawberryPerl. You could install cygwin on the USB drive. There are a lot more options out there. Interested in a LISP like portable/cross-platform and little language? Try newlisp (its a gem!). Also you could run almost anything (linux or windows based) on a portable VM under Portable VirtualBox/VMplayer or QEmu with a performance tax ;).

Camilo Estevez
  • 637
  • 1
  • 8
  • 16
0

http://smallbasic.sourceforge.net/

Runs anywhere (even mobiles) and has everything you need.

Jon Romero
  • 4,062
  • 6
  • 36
  • 34
-1

Why not C++? You can statically link in any external librarys assuming there lisence allows it, and you won't have any external dependencies.

Jared
  • 39,513
  • 29
  • 110
  • 145
  • That would be like creating software capable of running on a memorystick. The use case is write,run and revise my own code anywhere. – tovare Dec 20 '08 at 22:20