Welcome to Josl!

Josl is a high-level, general purpose, imperative, dynamically typed, interpreted, garbage collected, dynamic, modern and practical stack based language.

Getting Started

First, download a source release for Linux, FreeBSD, OS X, Windows or binaries for Windows. Second, look at some Example Code. Third, see the manual for an introduction, a tutorial and for language/word reference. Fourth, start developing your own applications in Josl!

What we’ve been doing?

Well, up until the 0.5.6 release, releases have been coming every 10-15 days, but the 0.6.0 release is taking much longer than that, why?

  1. Experimenting with targeting the JVM. I built an experimental version of Josl that would compile some simple benchmarks directly to .class files. This experiment proved to me that Josl could be built on top of the JVM, however, not with out some voodoo to handle some of the more dynamic parts of Josl. That voodoo, I did not venture into.
  2. Experimenting with targeting LLVM. I did not get to the point of making Josl compile to LLVM, however, … Continue Reading

LLVM, JVM?

While off on my business trip, I didn’t do much programming but did do some study on the JVM and also LLVM. I’m seriously thinking of targeting the JVM or LLVM. Currently Josl uses it’s own IL and interpreter. If I were to build upon the JVM or LLVM that would allow me to focus on the language details not so much the runtime environment which can consume quite a bit of time.

JVM or LLVM? Both seem easy enough to target but which would be a better choice?

JVM: Can immediately leverage TONS of code and packages and immediately benefit from … Continue Reading

MicroEmacs – By no means “Micro”

I’ve always been an editor fan. I’ve spend considerable time with Emacs, Vim and various Windows based editors. All have their benefits and their downfalls. When in one, I find myself wishing for the feature of another. MicroEmacs (don’t let the website scare you away) is no different, however, of all the editors I’ve used, it’s by far the easiest to get setup and customize to your likings. It’s also far from Micro! I often wonder if the name is the reason why it has not grown to fame as some other editors. MicroEmacs tells … Continue Reading

Version 0.5.6 – Released

Downloads:

Release Notes:

  • Added FFI callback support -ffi-callback
  • Added star variant words *=, *not=, *>, *<, *>=, *<= and *between?
  • Added random words rand and seed-rand
  • Added dip and 2dip
  • Added curry?
  • Added quick stack access words '0, '1, '2, …, '9
  • Fixed socket words in the documentation due to renaming in the 0.5.5 release
  • Added -constant
  • Added -enum
  • Tested and documented -rename
  • Added user based sorting (sort-user), documentation and tests
  • filter now functions on strings as well as lists and arrays
  • Added ii, jj and kk which function as i, j and k but return the count … Continue Reading

Star Variants

I’ve just committed code that includes what I call a star variant. We have them already as *if, *until and *do. These star variants are simply variants of the base word that does not drop their tested value. The new star variants are *=, *not=, *>, *<, *>=, *<= and *between?. A very simple example prior to having these variants, a short clip from a binary search word:

1
2
3
4
# ( needle haystack low high -- index )
bin-search-
  2dup > if 4 drop# -1 return end
  2dup = if nip swap @ = return end

With the new star variants, … Continue Reading

Version 0.5.5 – Released

Downloads:

Release Notes:

  • Added exception handling
  • Added new loop iterator each-rev and each-kv.
  • Added new loop jump words continue and break.
  • Added new library, record.j which will construct on the fly record type structures. Included words are: make-record.
  • Added new array words: capacity, array-resize and append.
  • Arrays are now resizable, automatically via … Continue Reading

Version 0.5.1 – Released

0.5.1 was released to fix a silly build issue with Linux. Something in my bash scripting allowed a failed build to report as passed. I’ll be debugging that later, but for now, 0.5.1 is out and contains only build/install fixes for Linux. No other changes were made.

Version 0.5.0 – Released

Downloads:

Release Notes:

  • Added new word each which iterates through each value of an array or list
  • Added functional words: map, filter, fold, and foldr.
  • Added quotation (anonymous word) support: my-list @ { 10 + } map
  • Added cross-platform sockets, words include socket, sock-bind, sock-listen, sock-accept, sock-close, sock-send, sock-receive, sock-send-to, sock-receive-from, sock-serv-by-name, sock-serv-by-port, sock-host-by-name, and sock-host-by-addr. Various constants were also added to support these words.
  • Various socket examples were added including sock_server.j, sock_client.j, httpd.j, udp_server.j and udp_client.j.
  • Updated dist Makefile target to include examples and tests.

Future:

Error Handling?

Currently, words return their expected results or an error code. I was thinking of a better error handling system and I borrowed a bit from Icon for this idea. What if every word could fail (which is basically true) but not place error information on the return stack but set a word based failure flag. For example, maybe you are coping a file, the current code would look something like:

main
  "./newdir" dir-create 0= if 
    "failed to create newdir" println 0 exit
  end
  "file.txt" "./newdir/file.txt" file-copy 0= if
    "failed to copy file" println 0 exit
  end

So, after each word you are checking a “return” value that is placed on the stack. The key here is you must pay attention to the return value because it’s placed on the stack and needs to be removed. Let’s look at using the word based failed flag:
Continue Reading

In ArchLinux via AUR

Thanks to Kyle Keen, Josl is now available in ArchLinux via AUR. You can view the package details at: ArchLinux – Josl.

Thanks Kyle!