Hacker News new | ask | show | jobs
by Joboman555 2947 days ago
Constructive Criticism: I could not find any code examples on the website within 3 minutes of searching, gave up, and left.
4 comments

I persevered following the "Learn" link. Then went to the Github page. https://github.com/AvailLang/Avail/blob/master/distro/src/ex...

Not impressed tbh.

    Module "Hello World"
    Uses
	"Avail"
    Extends
	"Avail" =
	(
		"keyword lexer"
	)
    Entries "Greet"
    Body

    Method "Greet" is [ Print: "Hello, world!\n"; ];
I have a blog post from a few years back with a sample, here: https://klibert.pl/posts/avail-and-articulate-programming.ht...

I'm pasting a link because I added on-hover popups explaining parts of the snippet, but here is the sample itself:

    Module "Hello World"
    Uses
        "Avail"
    Entries
        "Greet Router"
    Body

    Method "Greet Router" is [
        socket ::= a client socket;
        target ::= a socket address from <192, 168, 1, 1> and 80;
        http_request ::= "GET / HTTP/1.1\n\n"→code points;

        Connect socket to target;
        Write http_request to socket;
        resp_bytes ::= read at most 440 bytes from socket;

        Print: "Router says: " ++ resp_bytes→string ++ "\n";
    ];
This looks like the result of a drug-and-alcohol-fueled unplanned pregnancy between COBOL and Ada.
Yeah, plus a bit of APL - it's not visible in this snippet, but Avail uses a lot of strange unicode characters/symbols. The `→` in `resp_bytes→string` is one example, but there are many more symbols used: http://www.availlang.org/about-avail/documentation/unicode-c...
If you grab the development branch, you can use the modular lexers to make that a little bit clearer. If memory serves, “a socket address from <192, 168, 1, 1> and 80” can now be written “192.168.1.1:80”. Not because that syntax is designed into the language, but because the language is designed to allow an IPv4 lexer to be defined within the language. See distro/src/avail/Avail.avail/IO.avail/Address.avail:149 for the actual Avail code that lexes (produces tokens from module source) IPv4 addresses.
Apparently the code examples don't display with JavaScript turned off.
I had the same experience with JavaScript enabled
If you wouldn’t mind, please post a screenshot where you think an example is supposed to be displayed but isn’t. Or mail it to “mark” at the same address as the website.
There's a couple in this section[0] of the FAQ. I don't know whether it's because I'm too used to using traditional languages, but it does not look at all pleasant to write (IMO). Interesting idea though.

[0]: http://www.availlang.org/about-avail/documentation/faq.html#...