void ; the "nothing" value
10 ; an integer
12.34 ; a float
2/3 ; a ratio
\space ; a character
\A ; another character
baz ; a symbol. Bard is case-sensitive; baz and Baz are
; different symbols.
:Foo ; a keyword.
Bar: ; also a keyword. :bar and bar: are different ways
; to write the same keyword
true ; a Boolean
false ; the other Boolean
() ; the empty sequence
[] ; another way to write the empty sequence
(sequence 0 1 2 3 4 5)
; an expression that returns the sequence 0,1,2,3,4,5
[0 1 2 3 4 5]
; another way to return the sequence 0,1,2,3,4,5.
; In Bard, as in other Lisps, "(foo bar baz)" applies
; the function foo to the arguments bar and baz.
; Written this way: "[foo bar baz]", the expression
; denotes the same sequence, but also tells Bard to
; treat it as a literal sequence, and not as a function
; call. It's syntactic sugar for the "(sequence...)"
; expression.
"" ; a text object
"Hello!" ; another text object
(0,1) ; a pair
(,) ; the empty pair
{} ; the empty map
{ greeting: "Hello!",
length: 5}
; a map containing two entries
(protocol Addable (add <Number> <Number>))
This expression defines a protocol named "Addable", a function named "add", and a category named "<Number>". It's a very simple protocol, with just one function; in most cases, protocols will define many functions and categories.
(define-method add ((x <integer>)(y <integer>))
(+ x y))
? (isa? <integer> <Number>)
true
? (isa? <float> <Number>)
false
void ; <void>
10 ; <Integer>
12.34 ; <Float>
2/3 ; <Ratio>
\space ; <Character>
\A ; <Character>
baz ; <Symbol>
:Foo ; <Keyword>
Bar: ; <Keyword>
true ; <true>
false ; <false>
() ; <empty-sequence>
[] ; <empty-sequence>
[0 1 2 3 4 5]
; <Sequence>
"" ; <empty-text>
"Hello!" ; <Text>
(0,1) ; <Pair>
(,) ; <empty-pair>
{} ; <empty-map>
{ greeting: "Hello!",
length: 5}
; <Map>
(foo bar baz)
bard.lang.<Number>
(in-module user)
(import (bard.lang.<Number>))
Comments
plumenator (unauthenticated)
Feb 10, 2010
Is there an implementation I can try?
Tim Daly (unauthenticated)
Feb 10, 2010
Have you looked at Axiom? http://axiom-developer.org
mikel evins
Feb 10, 2010
> Is there an implementation I can try?
Not yet. As I said in the post, I can write simple programs in the CCL-based implementation, but it's not ready for other people yet. Think of it as a car with half the engine stretched out across the workbench. I can start it up and run it, and I can work all the controls and they do the right things, but it's not really drivable yet. Soon. I'm not sure exactly how long, because paid work, and work I'm investing my own money in have to come first.
mikel evins
Feb 10, 2010
> Have you looked at Axiom? http://axiom-developer.org
I hadn't. Thanks for the link!
Martin Kühl (unauthenticated)
Feb 11, 2010
Bard sounds very interesting; thanks for going public with it.
Jason Baker (unauthenticated)
Feb 27, 2010
> but it's not ready for other people yet.
Allow me to play devil's advocate. Have you seen the video "The Myth of the Genius Programmer"? It certainly influenced me a lot on these kinds of issues.
http://code.google.com/events/io/2009/sessions/MythGeniusProgrammer.html
mikel evins
Mar 1, 2010
I'm not hiding Bard away because the unwashed masses are unready for it. There's simply no point in making a language implementation available before you can write programs with it. It's probably not terribly long before I pass that hurdle. I showed the Twin City Lispers the compiler tests that were working last week, and the core logic of the VM. (Lest I confuse anyone, I'm talking about two totally different implementations here; the compiler that is passing tests is implemented on top of Clozure Common Lisp and compiles to native code by way of Lisp; the VM is a separate implementation in Haskell, done for the pure pleasure of seeing what it's like to write very low-level code in a very high-level language.)
When I can write a simple program with it that runs, I'll make it available, after I write a little documentation to explain it.