Open ahungry opened 4 years ago
I think putting an official image on docker hub would be nice, as the official image could be quite small and easy to maintain.
I personally don’t feel like maintaining or even advocating for distro packages, but other people are free to do so. If Janet does land in Debian or Ubuntu, I would work to ensure backwards compatibility somewhat as those are less rolling releases than things like arch, homebrew, and gentoo.
It’s also worth noting that to have a good experience with Janet and jpm, having a C compiler toolchain installed is useful, as well as git. And once you have a toolchain and git, installing Janet from source is pretty simple.
So I think for the docker image, it would be good to have a janet-micro image, which is like alpine Linux and with no git nor gcc, and a janet-development image which has gcc and git installed so jpm will work.
On a related note, here is a script to build and install janet into /opt.
#!/bin/bash
set -e -o pipefail
version=1.8.1
url=https://github.com/janet-lang/janet/archive/v${version}.tar.gz
mkdir -p $HOME/dist
if [ ! -e $HOME/janet-${version}.tar.gz ]; then
wget -O $HOME/dist/janet-${version}.tar.gz $url
fi
cd /tmp
rm -rf janet-${version}
cat $HOME/dist/janet-${version}.tar.gz | gunzip | tar x
cd janet-${version}
make PREFIX=/opt/janet-${version}
make test PREFIX=/opt/janet-${version}
make install PREFIX=/opt/janet-${version}
ln -sf /opt/janet-${version}/bin/janet /usr/local/bin/
ln -sf /opt/janet-${version}/bin/jpm /usr/local/bin/
Edit: the above was tested on Debian (Buster) (i686, x86_64, ARMv5), Raspbian (Buster) (ARMv7), and macOS (Mojave) / Homebrew.
By the way, the above script works on Windows 7 / MSYS2 if you make the following modifications to the Makefile
:
-rdynamic
from the LDFLAGS
lineln -sf
lines in the install:
targetOne of the test cases fails under Windows 7 / MSYS2:
error: unable to create temporary file - Permission denied
in file/temp
in _thunk [test/suite7.janet] (tailcall) on line 300, column 10
make: *** [Makefile:191: test] Error 1
I ran into issues on OS X (Tiger, PowerPC) due to missing clock_gettime
, arc4random_buf
and posix_spawn
.
Startup time is fantastic!
time janet -e '(+ 1 1)'
Startup time is fantastic!
Not just the startup time! Janet is, like, crazy-fast.
$ thyme 100 janet bf.janet hw.bf
26 0.003
64 0.004
8 0.005
2 0.006
That's executing this brainfuck interpreter on this input, and doing so practically immediately on an i5-5300U. Serious candidate for new sweet-spot Lisp.
Ooh, what is thyme
? Having trouble googling it.
Ah, that's just a little zsh function I have for running the time
builtin repeatedly and collecting the results into a histogram:
thyme() {
n=$1; shift
repeat $n do
(time $* > /dev/null) 2>&1 | cut -d ' ' -f 9
done | sort -n | uniq -c
}
It's not exactly surgical, but it works fine for off-the-cuff benchmarks.
(sorry for the thread hijack!)
A while back I used a trivial (non-tail-recursive) fibonacci benchmark to compare startup latency and raw function-call throughput of some scheme interpreters: https://gist.github.com/cellularmitosis/aa3001c8d5a961f7b382f6576978b644
Today I updated this by adding Clojure, Planck, Joker, and Janet.
Again, Janet's startup latency is crazy! Additionally, its throughput is also impressive, when you consider that Chez, Clojure, Planck, Racket are all JIT'ed.
I should add Guile 3.x, as that includes as JIT as well.
You could use the open build server to build rpm and Deb packages and docker images. https://openbuildservice.org/2018/05/09/container-building-and-distribution/
What are you talking about? Among all languages I tried, janet integrates the best with linux distribution package managers. Raku was the second best in terms of distro integration. Raku is pretty good, too.
I already integrated janet and jpm modules with gentoo linux and arch linux.
@amano-kenji who are you addressing?
My request here is that janet be in the official distributions, which is more of a maintenance request and not denying what you've stated (that janet is very portable).
pacman -Ss janet
- still no results.
pikaur -Ss janet
- produces janet-lang
and some other candidates - so, that's a great improvement! Please note this thread is now 2 years old, and I don't think janet-lang was in the Arch linux AUR back then.
Maybe my original intent was more to press for the advocacy steps to promote janet interest in those distribution channels - obviously the debian/arch maintainers are unlikely to read/respond to this thread, so such a request for action would probably have to originate there and not here :smile:
Janet runs quite nicely in a base alpine docker image as such:
If you were to make an official repo on docker hub, you could allow people to run this very small image of a janet repl/runtime with no more needed than:
While also serving as a strong base for a build image.
Similarly, having "pacman -S janet" or "apt-get install janet" just work out of the box would really help with proliferating the language.
thoughts?