The Salmon Programming Language
Programming against the flow!
Welcome to the home page of the Salmon Programming language. Salmon
is an open-source, general-purpose programming language. It is
designed for a range of programming tasks, from quick and simple
scripts and prototyping up to large multi-developer projects.
Salmon is designed for both compilation and interpretation. There is
currently a free, open-source, public-domain interpreter that is
designed to run on many different platforms. The compiler will be
coming in the future.
WANTED: Early Adopters
Do you like trying new things? Are you not afraid to try doing
something differently than most people? Do you think learning about
new programming languages is fun? Then we want you!
Salmon is a brand new language, so it needs people to try it out. It
needs people to spend some time to learn it. In needs people to see
how it works in the real world, in various settings. It needs people
to give feedback on what works and what doesn't in Salmon.
Every programming language was new once. Right now, Salmon is there.
Be there with it.
Read a bit about Salmon. Install it. Play with it.
Or, if trying new programming languages isn't your thing, spread the
word. If you know people who might be interested in trying it, help
get the word out, and point those people here.
Thanks in advance!
Some documentation is currently available for Salmon, and more is
coming soon. Here's what is already available:
a description of the SalmonEye
interpreter and how to use it.
the RosettaCode site has various programming tasks written in several
different languages, allowing you to see how the same task could be
done in each language; Salmon is one
of those languages.
some example Salmon code.
This page has some example code that shows some of the basics of
Salmon to get you started using it.
a summary of Salmon's
features. This is a high-level overview of major features, with
links to more details and examples for some of those features. It is
intended for those who have some familiarity with programming
languages and the terminology used to describe them.
the full Salmon Reference
Manual. This is a long, detailed description of the language that
isn't intended to be an introduction to the language.
The interpreter for Salmon is called SalmonEye. Binary installation
packages are currently available for 25 different Linux
distribution/architecture combinations, and more are on the way (many
thanks to Tommy Ettinger for getting Salmon working on all those
distributions, and to OpenSUSE.org for providing build services). To
get one of the pre-built binary installation packages, follow this
Salmon Linux Binary Installation Packages
If you want to use Salmon on a Linux distribution that does not yet have a
binary installation package available, or on a different OS, or if you
just prefer to install from source, you will need to download the
source and build and install yourself. To download the source for the
latest version of SalmonEye, plus included libraries, tests, and
documentation, follow this link:
Once you've downloaded the sources, use gunzip and tar to extract the
files. Then cd into the directory that was just extracteed.
If you're building for a 64-bit Linux system, type
make CFLAGS='-Wall -fPIC'
This should build six versions of the interpreter,
some libraries, and some plug-ins. Type
This will install the interpreter and the files it needs. Now you're
ready to get started!
To test SalmonEye, type
run_medium_test_suite.salm. This will run more than 100
different test suites and tell you at the end how many of them passed.
SalmonEye is carefully constructed to require only ANSI C 1990 for
most of its features. So a basic version of SalmonEye should build on
nearly any platform.
Optionally, SalmonEye can provide more features on platforms that
support these features. The support for these additional features
conforms to the Posix standard wherever possible. For example, if a
system supports Posix, the SalmonEye multi-threading module should
build on that system.
SalmonEye is primarily developed on Linux, so it should build
out-of-the box on Linux. All the optional features of SalmonEye work
on Linux. The web server serving this site is written in Salmon and
running on SalmonEye on Linux.
SalmonEye can be built and run under Cygwin on Windows. Cygwin is a
development environment that provides the compiler, make utility, and
libraries to give the Posix support to unlock all of SalmonEye's potential.
While all SalmonEye functionality can be made to work under Cygwin,
there are currently a couple of problems that cause annoyances with
some of the features. First of all, unlike Linux, with Cygwin a
plug-in built for one version of SalmonEye will not work properly with
others. For now, this means that it's best to only use the standard
build of the interpreter (
salmoneye.exe) if you are using
plug-ins. Secondly, SalmonEye Cygwin can only find its plug-ins if
the path used to execute SalmonEye is a relative local path --
../bin/salmoneye mycode.salm works, but just
salmoneye mycode.salm won't work right with plug-ins.
There will probably be solutions for both these problems in the near future.
I don't currently own a Mac, so I can't build on a Mac myself. I
recently had access to someone else's Mac for a short time and tried
building SalmonEye. I found that the first variant of the SalmonEye
executable built and seemed to function properly in a few small tests
I tried. But when the make system tried to build the optimized
version of the executable (
salmoneye.fast), the linker
crashed with a floating-point exception. I would think a linker
should never crash with a floating-point exception, so I suspect this
is a bug in the linker Apple provides, but I didn't have a chance to
investigate further. This failure stopped the build, so I didn't have
a chance to see what else did and didn't work on the Mac.
I expected a few
#ifdef blocks in "platform_dependent.c"
and/or "platform_dependent.h" will be needed to unlock all the
features, but I see no reason they shouldn't all work on the Mac.
Until the Mac linker bug is fixed, you may need to build with
make 'FAST_FLAGS=-02 -DNDEBUG' (lowering the optimization
-02) or some such thing.
If you're interested in trying to get Salmon working on the Mac,
please go for it and I'll try to answer any questions I can. If you
do get it working, please let me know what you needed to do to make it
work and I'll see if I can make some changes for the next release so
others can build right out of the box.
As mentioned above, the core SalmonEye functionality is meant to be
very portable, so it should be relatively easy to port to any
platform. Depending on how different the environment is from
Linux/Posix, it may be more or less work to modify the makefiles and
perhaps make code changes in "platform_dependent.h" and
"platform_dependent.c" to make it work.
If you do try porting to another platform, please let me know how it
goes, whether it's a success or a failure. And if you have any
questions, please ask.
There are currently three additional Salmon modules you can download.
Sophie gives an interactive interface to the Salmon interpreter. It
has a REPL -- Read, Eval, Print Loop -- so you can type lines of
Salmon code and get them executed immediately and see the results.
It's a great way to explore Salmon. Sophie was written by Tommy
Ettinger and is available for download here:
The SalmonSockets module provides an interface in Salmon to sockets.
This allows Salmon to open network connections as either a client or a
server. It is built on the Posix socket interfcace, so it should work
on any Posix-compliant system. It requires SalmonEye already be
installed. Here's the source tarball:
Porpoise is a web server written in Salmon. It requires SalmonEye and
SalmonSockets. It is the web server running this site, in the
interests of following the "eat your own dog food" principal. It
might be of interest as an example of a real Salmon program. It's
config file is itself Salmon code, so it is very extensible.
An area of launchpad.net has been set up for additional Salmon
contributions. Here it is:
Help Improve this Web Site!
This web site uses only the very most basic web design ideas. If you
know something about web design and have some ideas for improving this
site, please put up a mock-up of your ideas somewhere and show them to
me. If I like them, I might incorporate some of your ideas into this
site. My goal in the design of this site is to keep it clean and
Help Improve the Salmon Documentation!
Salmon could really use more in the way of tutorials, example code,
etc. If you spend some time to learn Salmon fairly well, use it for a
little while, and then think you can help communicate what you've
learned to others, please do so. If you post such documentation on
another site and I like it, I'll link to it from here. I might even
add it to this site, if you are willing to place it in the public
Salmon is free software. The interpreter, the documentation, and
everything that comes with it is in the public domain. So you're free
to incorporate it into any other work, whether that work is open
source or not. You're free to include it in GNU GPL software or
commercial, proprietary software. Everything else on this web site is
in the public domain, too. I only retain the rights to the name
"Salmon Programming Language".
Help and Feedback
For help, please e-mail salmon-help at chriswilson.info. To report a
bug, please e-mail salmon-bugs at chriswilson.info. To provide
feedback on your opinions about and experience with Salmon, please
e-mail salmon-feedback at chriswilson.info. For comments about this
web site, please e-mail salmon-webmaster at chriswilson.info.
Salmon was designed by and SalmonEye was implemented by Chris Wilson.
I hope some of you find it of some value. Thanks in advance for