more power and less verbiage

LSBU's Dennis Furey produced a language the likes of which you have never seen:

There is a very small subset of the language vaguely resembling pure Lisp, and any program expressible in the language is expressible in this subset. However, programs are written mostly using operators representing functional combinators.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

a quick example

For example, here's how you transcribe the conventional exhaustive Sudoku solver:

#import std
#import nat

#executable (<'par'>,<>)
#optimize+

sudoku =

~command.files; <.file$[contents: --<''>]>+ *= ~contents.&F; * -+
   ~&rSL+ (psort (nleq+)* <~&blrl,~&blrr>)+ ~&arg^& -+
      ~&al?\~&ar ~&aa^&~&afahPRPfafatPJPRY+ ~&farlthlriNCSPDPDrlCS2DlrTS2J,
      ^|J/~& ~&rt!=+ ^= ~&s+ ~&H(
         -+.|=&lrr;,|=&lrl;,|=&ll;+-,
         ~&rgg&& ~&irtPFXlrjrXPS; ~&lrK2tkZ2g&& ~&llrSL2rDrlPrrPljXSPTSL)+-,
   //~&p ^|DlrDSLlrlPXrrPDSL(~&,num*+ rep2 block3)*= num block27 ~&iiK0 iota9,
   * `0?=\~&iNC ! ~&t digits+-

On the off chance that this isn't self-evident, here's a quick explanation of two parts of the above program:

  • ~&irtPFXlrjrXPS ⇒ separate each member of a list of lists of pairs of lists into those with multiple items on the right and those without;
  • ~&lrK2tkZ2g ⇒ test that there are no repeated right sides in any of the left sides in a given list of pairs of lists of pairs.

Expressions like these can be verified interactively through "decompilation":

$ fun --main="~&DlrDSLlrlPXrrPDSL" --decompile
main = compose(
   reduce(cat,0),
   compose(
      map compose(
         distribute,
         field(((&,0),(0,(&,0))),(0,(0,&)))),
         compose(
            reduce(cat,0),
            compose(map distribute,distribute))))

I wonder what Paul Graham would say... Ah, who cares. What's important is that we know what Jack Hollingsworth would say to PG:

If you really want to put a language to the test, try it out on something it's not good for.

less verbiage?

Certainly interesting, but compared — at first glance — to what suffices in J for N queens:

(#~[:(0=>./)[:,/[:([:}.([:i.#)=[:|(]-"1{.))\.|:)(i.A.~[:i.!)

the Ursala version seems, well, a bit verbose:

%np+~command.options.&h.keyword.&iNC; -+
~&iNC+ file$[contents: --+ %nLP*=; * ''%=' ]']+ ~&rSSs+ nleq- ~&i&& ~&lNrNCXX; ~&rr->rl %tLnLtXLLWXMk+ ^/~&l ~&lrrhrSiF4E?/~&rrlPlCrtPX ~&r; ^|/~& ^|T\~& -+
- ^jrX/~& ~&rZK20lrpblPOlrEkPK13lhPK2; ~&i&& nleq$-&lh+-,
^/~&NNXS+iota -

(but not, as one might expect from the names of the two languages, 6 times as verbose...)

focusing on the wrong thing?

In other words, in terms of brevity Ursala seems to occupy the sweet spot between the Ken Iverson's J and Chuck Moore's Forth:

$ wc eight-queens.*
  32  176  755 eight-queens.f
   4   28  272 eight-queens.fun
   8   42  214 eight-queens.ijs
  44  246 1241 total

There certainly seems to be some demand for something like this. I wonder if the set of combinators available in Ursala is more important than its terse syntax. (Remember, you can write more verbose Ursala if verbosity equals readability in your book.)

I also wonder how it compares to other "scientific" languages like, say, Yorick or Fortress in terms of the ease of heavy-duty numeric computations.

Combinators are a good thing if

Combinators are a good thing if the combinators correspond to a solid, formal model for the particular problems they are intended to be used to address. Otherwise you're getting brevity at the cost of not being able to reason effectively about your program.

Actually I have seen it before

In the old days, I knew what to do with that sort of code; namely, change the baud rate on the terminal. Nowadays that doesn't seem to help.

Ouch! Are you sure that

Ouch! Are you sure that isn't the first few lines of a PDF that the web server marked text/plain by mistake?

I love that it calls itself

I love that it calls itself Universal. Brevity yields "dramatic improvement in productivity".

Is that why almost all code in the documentation is in shorthand notation?
God... What do we gain over APL?

Right...

I think I'll stick to a more intuitive, straightforward language like brainfuck.

You mean MUMPS

I've interfaced with Meditech MAGIC a fair amount in my working on datamining analysis of hospital billing processes; knowing the language is critical for verifying dataflow problems in hospital processes for hospitals that use Epic or Meditech as their MIS/ERP system.

I believe MUMPS is the closest there is to brainfuck in the real world.

It's actually not that bad once you learn how to read it.

Ursala has interesting data types

Besides the unconventional syntax, Ursala has an interesting unconventional data model. At a core semantic level, the only data type is the unlabeled binary tree; in other words, you get CONS and NIL, and that's it.

There are predefined encodings for characters, integers, floating-point numbers, etc., as unlabeled binary trees, so typically you don't need to care about the underlying data model; but you can always destructure a character and access the underlying tree if you want.

I've only read the reference manual, and never tried to actually use Ursala, so I can't be sure; but I get the impression that the virtual machine is more conventional than this sounds, and actually uses native data types unless your program does something strange like destructure a character.

Time taken

I use pretty complex algorithm to solve sudoku puzzles at Online Sudoku Solver. Just out of curiosity, how much time does this brute force solve take ? Would be great if we compare the timings.

Interesting work

Just came across ursala and ok the abbreviated syntax looks very hard to decipher. On the other hand, I think there's lots of things of interest in the documentation -- carl touched on a bit above.

* Accessors into data structures mirror the shape of structures themselves. Moreover, there are machine-level "pseudo-pointers" that give, e.g. alternating items of lists etc. So there's a whole mini-language purely for deconstruction.

* The type language is equally powerful. Type expressions can generate random data automatically -- i.e. built-in quickcheck. Native types for grids and lattices are also of interest. Different types can be applied as "views" to the same raw data structure underneath.

I'm sure there's other stuff as well -- but from a PL standpoint those two jumped out at me.

hilarious

johnwcowan, lodi, and sean crack me up.

el-vadimo: Have you ever seen the 4th.CoSy project? I heard about it, but never got it to compile code.