7 ms·
Avail Programming Language
- Joboman555 8y agoConstructive Criticism: I could not find any code examples on the website within 3 minutes of searching, gave up, and left.
- kccqzy 8y agoApparently the code examples don't display with JavaScript turned off.
- nicklovescode 8y agoI had the same experience with JavaScript enabled
- markvangulik 8y agoIf 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.
- emmelaich 8y agoI persevered following the "Learn" link. Then went to the Github page. https://github.com/AvailLang/Avail/blob/master/distro/src/examples/Tutorial.avail/Hello%20World.avail 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"; ];
- Sean1708 8y agoThere'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#q3 http://www.availlang.org/about-avail/documentation/faq.html#...
- klibertp 8y agoI have a blog post from a few years back with a sample, here: https://klibert.pl/posts/avail-and-articulate-programming.html 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"; ];
- masklinn 8y agoThis looks like the result of a drug-and-alcohol-fueled unplanned pregnancy between COBOL and Ada.
- klibertp 8y agoYeah, 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-cheat-sheet/index.html http://www.availlang.org/about-avail/documentation/unicode-c...
- markvangulik 8y agoIf 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.
- deleted 8y ago[deleted]
- seanmcdirmid 8y ago> An infinite algebraic type lattice that confers a distinct type upon every distinct value. Intrinsic support for a rich collection of immutable types, including tuples, sets, maps, functions, and continuations. Ok, I consider myself OK at type theory but I'm still lost in what this claim actually means. And if it is what I think it is (that all values have types), I wonder how this doesn't run afoul of decidability of fancy dependent type systems (perhaps 1 has a type, 2 has a type, but 1 + 2's type isn't 3?).
- tathougies 8y agoAvail does not seem to have dependent types. The term 'dependent type' is overused. It means that the type system must allow the compile-time type of an expression to depend on the run-time value. This is not totally decidable. Most type systems, including advanced ones, such as Haskell's, do not have this property. Avail seems no different.
- markvangulik 8y agoHaskell has infinite and recursive constructs, lazily computed. That’s what makes their type system undecidable. Avail is constructivist in that sense, so immutable structures must be finite (i.e., you can draw them as a dag). For cyclic structures, you have to include mutable “variable” objects as well, but in that case the type of the construct stops at the boundary of the variable. The type of a tuple of variables is a composition of the declared types of the variables, not their current content. This is essential to ensure an object’s type is permanent, and the immutable acyclicity condition ensures everything reachable without hitting a variable contributes to an object’s type.
- tome 8y ago> Haskell has infinite and recursive constructs, lazily computed. That’s what makes their type system undecidable. Haskell (98) has infinite and recursive constructs and its type system is not undecidable.
- tathougies 8y ago
- qop 8y agoSomeone smart needs to explain what an infinite algebraic lattice is, because it sounds awesome. Potentially. Edit: (I just googled "algebraic type lattice" and while ymmv, I don't recommend it unless you're well versed in scary black mathic) I didn't get too in depth with reading the docs, but any language that goes for non ascii symbols a la APL is going to be fighting an uphill battle right from the get go. Maybe it was a bit easier even for apl because there were interfaces more immersive than what we have now for non ascii, especially when mixed with regular ascii. Type type type, oh wait, backslash, dropdown, there's my symbol, enter, type type type. That's not very fun. That's less fun when youre dividing your cognition between what things im actually trying to accomplish and what things I have to type. Just my two cents, no ill will
- DoofusOfDeath 8y agoFWIW, latices are a pretty easy concept once you grok the basic idea. I first encountered them when doing work-related reading on dataflow analysis, and I'm very glad I did. Interesting stuff. (edit) Summary: the topic might look scary at first blush, but it's actually not.
- tathougies 8y agoA lattice is a partial ordering where any two elements have a supremum and infinum. I.E., for any two types in avail's lattice, there is a unique super type, and a unique sub type. A partial ordering means that -- given any two elements -- I can say that either one is a subtype of the other or that the types are not in relation. The super type of every type is known as 'top', and the sub type of every type is known as 'bottom'. An infinite lattice just means that there is an infinite amount of types in the Avail type system.
- markvangulik 8y agoWell said, that’s exactly right. Most languages lack a bottom type, or screw it up by pretending that “null” fits that role and falsely promises everything that every other type promises. Languages like Java (and many more) fail to even have a top type, which leads to kludgey add-ons to the type system — boxed, @Nullable, erased generics, annotations, dependency injection, purity annotations, etc., all of which should have been part of a single type system.
- blt 8y agoIMO, the landing page of any programming language site should include some code samples demonstrating what makes the language different from the crowd.
- qop 8y agoYes definitely. The old racket-lang site used to be the PERFECT programming language landing page. Imo. But it had to be close to like actually perfect too.
- codetrotter 8y agoCan you find it on archive.org and link it for reference?
- qop 8y agoYou can't take ten seconds to browse there? Seriously?
- codetrotter 8y agoI can’t know which previous version you are talking about. I would have to look at a lot of snapshots and still I could only guess. Only you can identify the version quickly and link it for us.
- FractalLP 8y agoThe landing page does http://www.availlang.org/index.html http://www.availlang.org/index.html I tried to link to a more interesting page though. I stumbled upon someone mentioning the language, but don't really get it. It seems to promote building DSLs, but lots of languages like Lisp & Rebol have been doing that for ages.
- pure-awesome 8y agoOh! I understand your intent, but I think it unfortunately ended up confusing matters for fellow readers. Add to this the fact that the website itself is not very clear already...
- sanxiyn 8y agoThis reminds me of The Osmosian Order of Plain English Programmers.
- GerryRzeppa 8y agoThe Osmosian Order is alive and well. https://osmosianplainenglishprogramming.blog/ https://osmosianplainenglishprogramming.blog/ And we're about to release Español Llano, the Spanish version of Plain English. This new compiler compiles Spanish and English. Or both, even in the same sentence. Kind of like a bi-lingual human.
- skybrian 8y agoIt looks like GitHub is active [1], but documentation hasn't kept up. The blogs don't seem to have been updated since 2014, and the links to the mailing lists are broken. [1] https://github.com/AvailLang/Avail https://github.com/AvailLang/Avail
- markvangulik 8y agoWorking on it, sorry about that. We lost some things when rehosting some time ago and have prioritized other things. There is no mailing list any more.
- wiradikusuma 8y agoPrint 1 to 10, as a comma-separated list. In e.g. Scala, you can do that: print( 1 to 10 mkString "," ) It's not 100% human language/grammar, but close (and you have auto-completion using IDE). Why would you need another DSL? (Not trying to bash Avail, nor promote Scala, just curious for its usecases)
- jhall1468 8y agoI'm pretty sure the goal of these "natural language style" programming languages extends beyond printing a comma-delimited list of numbers. This arbitrary example doesn't mean much.
- p1necone 8y agoIt's not a very good example though - it's not showing me any sort of improvement over actual programming languages - just an intentionally bad bit of code.
- Athas 8y agoI agree; defining well-named functions seem a superior solution. In Haskell, it would just be: print (intercalate ", " [1..10]) I don't buy natural-language-ish programming languages. The grammar becomes far too complicated very quickly. A simple but flexible grammar, a la most functional languages, is superior.
- cyberferret 8y agoWhile I believe 'plain English' type programming languages are a great concept, the reality is that it just introduces far more ambiguity into the mix, and you are just left trying to guess what the language designer's vagaries are. I came across this years ago when trying to get to grips with the then new fangled Ruby language. I kept having to go back to the documentation to remember the best way to convert a string to all uppercase... was it: str.upper str.uppercase str.ucase str.upcase str.capitalize (<- Don't even get me started on the regional differences of 'ise' vs 'ize' between US and UK English variants) ??? Even here, I would probably start using Avail, then in a few weeks I would be scratching my head and asking, was it: Print 1 to 10, as a comma-separated list or Display 1-10, in CSV format
- tambourine_man 8y agoYeah, that was my problem with AppleScript. It’s a read-only language to me. It took me years to try other languages and discover I could actually write code.
- mpweiher 8y ago"The experiment in designing a language that resembled natural languages (English and Japanese) was not successful." -- William Cook Any programming language that tries to do "natural language" should at least reference the AppleScript HOPL Paper[1] and say how they are doing things differently to address the (now) obvious problems. (Oh, and there is a LOT of good stuff in the paper, definitely worth a read). [1] http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf
- ontologiae 8y agoI think all experiments of languages that resembled natural languages will never work until one will try to ascend to a more high-level paradigm. Actuals programming language are based on a "forklift paradigm" : you describe the path of a forklift in a virtual warehouse where data's are in some places and your forklift move them from places to places. So a natural language isn't design to express this kind of semantic. In PPIG ( Psychology of Programming Interest Group ) 2006 was published a very interesting paper where is studied the metaphors which was shared by the core java library authors, the mental model said in another way. It reaveals very interesting facts : Programmers tend to think the world in term of Belief-Intention agents. Agent are members of a society who trade and own datas and are subject to legal constraints. A method calls is a speech act. The execution is mentalized as a journey in a a spatial world. Etc. There's a lot of metaphors like that, and it reveals tracks to conceive a more high level language. So there's a lot of work in this field (Behavior-Tree based language, time dimension include inside the semantics, etc.). Note that it is also possible to express non ambiguigous semantics in natural language : Attempto Controlled English is an exemple [2]. Here an toy example of what you could do with this language : "MyWebPage is a webpage. MyWebPage contains a textfield which a logical name is-named NameTextField. His label is "Name". MyWebPage contains a button which a logical name is-named SubmitButton. His label is "Submit". If User clicks on Submit and NameTextField is empty then NameTextField ' s css class becomes AlertEmptyInput. " [1] http://www.ppig.org/sites/default/files/2006-PPIG-18th-blackwell.pdf http://www.ppig.org/sites/default/files/2006-PPIG-18th-black... [2] http://attempto.ifi.uzh.ch/site/ http://attempto.ifi.uzh.ch/site/
- p1necone 8y agoThe example at the beginning strikes me as a bit over the top. Something like 'String.Join("," Range(1,10))' (pseudocode, but you get the picture) would be better, and avoid all the ambiguities of the plain english version.
- 3131s 8y agoMy ideal syntax for that expression is very close to yours, something like str.join(1..10, ', '). Looking at our two approaches I noticed something -- yours has no space after the comma, and mine does, so how would Avail express that distinction without becoming even more verbose?
- deleted 8y ago[deleted]
- colanderman 8y agoI find the syntax hard to follow for the express reason that variable names and function names have no distinguishing features. If variable names were decorated somehow (a symbol, or color) it would be much easier to visually parse a function call. As is, my brain must remember exactly the (complex) names of functions and variables in scope to determine how to parse a function call. But I like the idea and am using something similar in a language I'm developing.
- markvangulik 8y agoWe’re working on tools for writing/viewing Avail more easily. Stay tuned, it’ll be worth the ride...
- kccqzy 8y agoIt'd be better if the tutorials are rewritten in a more concise manner. Do you really need that many words to explain Guess The Number? http://www.availlang.org/about-avail/learn/tutorials/guess-the-number.html http://www.availlang.org/about-avail/learn/tutorials/guess-t...
- IvyR0gue 8y agoSuper cool. Going to have to check this out.
- deleted 8y ago[deleted]
- dcw303 8y agoI'm confused by the website. The intro has a clear example that reads like natural language processing, but the FAQ goes out of the way to stress that the language does not do NLP. At that stage it gets a bit ranty, vague and dense, and I kind of lost interest. Perhaps I'm not smart enough to get what they're trying to do. "Developing a domain-appropriate lexicon and phraseology". Is this a DSL? Regardless, I don't see this setting the world on fire. It's interesting that they've called this paradigm Articulate Programming, because articulation of the domain is where the problem both starts and ends. How many times have you worked in a company with staff who start off exasperated with how complex IT makes solving a business problem, only to be surprised at just how many details are in their day to day processes once you've spent time covering off all the edge cases and writing tests around exceptions. Code becomes complicated because the domain it models is complicated. Hence the reason why a good engineer's most important skill is in gaining an understanding of the real world problem domain, and expressing that as code. And also why I'm not worried of AI taking my job any time soon.
- bbeonx 8y agoSame. I guess my takeaway is that I'm happy people are looking into this because in ten (or twenty (or a hundred)) years this research will hopefully have paid off. I, however, want nothing to do with it. Also, they don't do natural language processing but allow you to write method names like "the square-root of _x^2 + _x + _" where the underscores are arguments. Thus their "efficient" compiler that they parallelize the parser to find an unambiguous parse. I don't know. This seems like it would be super fun to write and to play with, and that there are probably some really cool new things being discovered that, when matured and properly integrated, may be workable into a usable programming language.
- dang 8y agoFrom 2014: https://news.ycombinator.com/item?id=7667706 https://news.ycombinator.com/item?id=7667706 From 2015: https://news.ycombinator.com/item?id=9043561 https://news.ycombinator.com/item?id=9043561
- dwarfylenain 8y agoCobol 4ever ;)
- markvangulik 8y agoPerhaps. But wouldn’t you prefer that COBOL become a mere dialect of Avail?
- mikkom 8y agoHere is some code from their examples page if anyone else (like me) is more interested in how the actual code looks like. To be honest, I'm not sure how much clearer this is to read than for example Python. http://www.availlang.org/_examples/guess-the-number/Guess%20the%20Number.avail http://www.availlang.org/_examples/guess-the-number/Guess%20...
- toolslive 8y agoobligatory xkcd: https://xkcd.com/568/ https://xkcd.com/568/
- geoelectric 8y agoI really hate programming in AppleScript, which also attempted a similar syntax, because it's in the uncanny valley of semi-structured English. It's too close to the language I speak such that remembering all the special cases (which prepositions link which operations, sentence structure, etc.) becomes really difficult. I like some well-structured separation in my coding languages. It's not a downside for me at all.
- markvangulik 8y agoThe core syntax of Avail does have a prose-like feel to it, and that’s intentional. But when you narrow it or extend it for specific linguistic domains (CSV, tensors, business rules, build rules, expert systems, or a vast number of existing notations), it makes the code read exactly at the right level. No noise. Have a look at the Silly Quiz example for what I mean about getting the right level.
- IshKebab 8y agoFirst rule of programming language home pages - have a good selection of examples on the first page! This fails that horribly.
- beojan 8y agoSomeone looked at COBOL and thought, "That looks great".
- jillesvangurp 8y agoReminds me a bit of intentional programming, something that Charles Simonyi has been pushing for a few decades. As far as I know he might still be pushing this but I haven't seen much progress since 2002.
- thepratt 8y ago> But there are many career programmers who would rather say: > Print 1 to 10, as a comma-separated list. No, I would not. Don't make assumptions on behalf of others.
- thiht 8y agoIt says "many", not "every". But even then, I'm not convinced that "many" programmers would rather write the latter.
- stefanve 8y agoThere are many career mathematicians who would rather say: " add two to four and multiply the sum with three". Natural language mathematics (arithmetics)
- thepratt 8y agoWhat I'm contesting is the assumption of the majority. There may be a small sub-set of programmers who will prefer the example, but until Avail's usage/interest is wide-spread such an assumption has no validity.
- ljw1001 8y ago"Many" doesn't mean "the majority" any more than it means "every".
- markvangulik 8y agoRight, and that’s why Avail is nothing like that. Kind of the opposite when it gets down to it... Cheesy, closed languages like C forgot that exponentiation was even a thing, or complex numbers. If you shift over to using C++’s “clevernesses”, you still don’t get exponentiation, because the traditional caret symbol is already used for exclusive-or, which has no sensible ASCII punctuation. As for someone’s distant comment that Lisp has been used to create languages for years... sure, if the language you wanted was parenthesized lists with keywords inside the left parenthesis. Which is just Lisp with a few more operations and macros. Yuck.
- bbeonx 8y agoTo be honest, this project is going the wrong direction. Rather than trying to get programming languages to look like human language, we need to get human language closer to computer language. By this I mean that every argument I've ever been in has turned out to either be an intrinsic disagreement about definitions (fixable, and usually we agree) or an intrinsic argument about god (probably not fixable, we will probably not agree). If the average person understood the beauty of a solid (and unambiguous) definition, I dunno, world peace and rainbows and butterflies? Probably not, but I'd definitely not have to rage-quit socializing so often. Still, with that said, from a purely intellectual curiosity standpoint this is neat. I hope that the general saltiness of the internet doesn't discourage the devs from working on this some more.
- pasabagi 8y agoI think there's actually a very fundamental difference between natural and formal languages that make this kind of project wrongheaded. Formal languages, at root, have exact reference. In a programming language, a symbol ultimately refers to a block of memory, or an operation. The problems of writing a formal language are ones of trying to express a given concept when the relation between symbols and references is known, but the relationship between concept and symbol is not. In natural language, a symbol ultimately refers to nothing. Its meaning is derived from context, convention, intention. As such, the relationship between concept and symbol is basically known - we know we are talking about red things when we use the word red. The relationship between concept and reference is absolutely unknown - we can never know for sure whether our concept 'red' is adequate to real red objects. As such, natural languages are a poor model for formal ones. The problems are essentially different. In one, you know how the symbol 'red' relates to operations and memory. In another, you know how the symbol 'red' relates to intention and meaning. Each has different challenges associated.
- kccqzy 8y agoThere are more ways to define semantics for formal languages than you suggested. What you described seemed to be mostly operational semantics where each term (or statement) ultimately causes some memory to be referenced or changed or an operation carried out. It is quite possible to define the semantics denotationally where each term (or statement) simply becomes an element in a domain. Its ultimate meaning can change depending on which domain you are using.
- pasabagi 8y agoGood point. I'd never heard of denotational semantics before. I'm coming from a more or less naive perspective of trying to pinpoint where the ambiguity is that you have to wrestle with in different kinds of languages. In formal languages, the classic problem is, what you say is not what you mean. In natural languages, the classic problem is, what you mean is not what really exists. So for the latter, we have the whole development of science, epistemology, empiricism etc. For the former, we have the whole notion of semantics, the development of tools like valgrind, tests, etc. Is there anything you can reccomend to read? I'm pretty familiar with how computers work on a mechanical level, but I'm pretty ignorant about the theoretical intuitions behind all the more functional stuff.