[HN Gopher] Eolang, an Experimental Object-Oriented Programming ...
       ___________________________________________________________________
        
       Eolang, an Experimental Object-Oriented Programming Language Based
       on -Calculus
        
       Author : abd-nh
       Score  : 63 points
       Date   : 2021-09-05 11:08 UTC (1 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | eurasiantiger wrote:
       | This looks really promisi--wait, _maven?!_
       | 
       |  _^W_
        
         | jaytaylor wrote:
         | Is this Java hate? Please chime in if I'm missing something,
         | otherwise..
         | 
         | There's nothing inherently wrong with writing a programming
         | language on top of the JVM or JVM-based build tools. It's a
         | time tested platform in very widespread use, and in many
         | instances the JVM is an excellent target to get things going.
         | 
         | The derision emanating from the low effort comment you
         | submitted is misguided and / or misplaced. This is coming from
         | someone who admittedly kind of enjoyed bashing on the
         | ridiculousness of Java in the early days ('90s & '00s), but
         | along with the JVM, it's grown into an incredible ecosystem and
         | generally valuable resource to Get Stuff Done.
        
           | iainmerrick wrote:
           | It's about Maven, not Java.
           | 
           | Having used Maven a bit in the past, I agree, it was awful.
           | Simple tasks were complicated and error-prone, complex tasks
           | were impossible.
           | 
           | It seems reasonable to ask why a trivial example program
           | needs a huge boilerplate XML file.
        
             | [deleted]
        
         | dathinab wrote:
         | You didn't reach the part where you are told:
         | 
         | - It's parsed into an XML document.
         | 
         | - And: There are a number of XSL transformations that need to
         | be done with the XML document in order to make it ready for
         | compilation.
         | 
         | - Plus: Then transforming the XML document into a collection of
         | .java files.
         | 
         | But hey, if this are the tools you are familiar with why not
         | use them for you pet toy.
        
       | Joker_vD wrote:
       | > EO is based on -calculus (if you want to see its description,
       | join this Telegram chat: @polystat_org).
       | 
       | Because putting this description into a doc/MATHS.md file inside
       | the repo itself is too easy.
       | 
       | Also, a tip for anyone who decides to put out there a programming
       | language with highly exotic operational semantics: please don't
       | forget to put a quick overview of that semantics in the
       | "Tutorial" section. I suspect most people would be puzzled why
       | output is performed by "making a copy of the abstract object
       | stdout with a single argument "Hello world!".
        
         | colonwqbang wrote:
         | I think it's supposed to be a parody? It's some made up OOP
         | version of lambda calculus.
         | 
         | The telegram chat thing is probably a reference to languages
         | like Elm who keep the community discussions on Slack and other
         | proprietary platforms which require login to view.
        
         | discreteevent wrote:
         | This example helped me:
         | 
         | [r] > circle                 mul 2 3.14 r > perimeter
         | mul 3.14 r r > area
         | 
         | The first line creates an "abstract" object named circle. It is
         | abstract, because one of its attributes r is "free". It's not
         | specified in this object and that's why the object can't be
         | used as is, it has to be copied with r specified. For example,
         | this is the circle c with the radius 30:
         | 
         | circle 30 > c
         | 
         | ( Which would be like c=new circle(30) )
         | 
         | https://www.yegor256.com/2020/11/24/objects-without-methods....
        
         | macintux wrote:
         | > Because putting this description into a doc/MATHS.md file
         | inside the repo itself is too easy.
         | 
         | Agreed. Even a link to Wikipedia would be useful: -calculus is
         | not the easiest thing to search for, and I'm certainly not
         | going to sign up for a Telegram account just to find out what
         | this is all about.
        
           | azalemeth wrote:
           | > In order to compile this program, put it into
           | src/main/eo/main.eo and then create a file pom.xml with this
           | content (it's just a sample):
           | 
           | > <a 47-line XML file />
           | 
           | I have little idea why this is here, what on earth it's for,
           | what -calculus is, or anything! I don't even know if it's
           | related to lambda-calculus, modal-u calculus, or _whatever_!
           | 
           | So, some highly speculative google-scholaring:
           | 
           | > [1] This article proposes a new arithmetic for fuzzy
           | numbers called ph-calculus developed at the LAMIH laboratory
           | (D. Roger and J.-M. Lecomte, 1996). For this algebra, the
           | modeling used for the representation of fuzzy numbers is the
           | distribution function instead of the classical membership
           | function. New functions (square, square root, power,
           | exponential, Neperian logarithm and trigonometric functions)
           | are defined in this paper. With the aim of handling simply
           | ph-calculus arithmetic and of comparing it with those of the
           | intervals theory (R.E. Moore, 1966) and the Zadeh's extension
           | principle for fuzzy numbers (L.A. Zadeh, 1965), a toolbox for
           | Matlab has been set up. Also, several examples and an
           | application of automatic control illustrate this algebra.
           | 
           | Aha! So, maybe it's a fuzzy number system -- where you have
           | inherent uncertainty on _everything_. That 's cool, and
           | useful, and something I can totally see the point of (not
           | least in an OO context -- _everything_ has to be an object,
           | as a fuzzy number is a generalization of a regular, real
           | number in the sense that it does not refer to one single
           | value but rather to a connected set of possible values, where
           | each possible value has its own weight between 0 and 1; and
           | that weight is called the membership function -- and a
           | function with some data is basically an object!). Maybe that
           | 's what it means. Maybe.
           | 
           |  _More googling_.
           | 
           | > [2] THE ph-CALCULUS - A HYBRID EXTENSION OF THE p-CALCULUS
           | TO EMBEDDED SYSTEMS. [...] The ph-calculus is a hybrid
           | extension of Milner's p-calculus [17] which allows processes
           | to interact with continuous environments. We choose the
           | p-calculus to extend to the hybrid setting because it has
           | already been shown to be a rich language in which many
           | interesting discrete concurrent phenomena can be expressed: a
           | language for, and theory of, communicating processes which
           | can reconfigure themselves; a language in which distributed
           | objects and classes can be defined; and a language and theory
           | capable not only of expressing communication, but arbitrary
           | computation, in that the l-calculus of Church can be
           | translated into it. This all suggests that successful hybrid
           | versions of the p-calculus and other process calculi will
           | have novel and elegant ways of expressing hybrid systems -
           | possibilities for distributed control which would be awkward,
           | if not impossible, to express in current formalisms.
           | 
           | Then again, maybe not! I'd _love_ someone to explain what
           | this is all about, ideally relatively simply.
           | 
           | [1] http://dx.doi.org/10.1109/ETFA.2006.355426
           | 
           | [2] https://www.eecs.umich.edu/techreports/cse/02/CSE-
           | TR-458-02....
        
           | diskzero wrote:
           | In the intolerant spirit of the EOLANG designers, signing up
           | for a Telegram account to learn about a language is something
           | _I_ won 't tolerate.
        
         | theamk wrote:
         | They do have a paper in the repo:
         | https://github.com/cqfn/eo/tree/master/paper
         | 
         | According to it, "-calculus" is something they made up for the
         | eolang and not a standard term.
         | 
         | Here is my take on that calculus based on reading through
         | section 3 in the paper. Note the paper is pretty weird and
         | likes to make its own notation, so it is possible I got some
         | things wrong:
         | 
         | It is starts with a pretty standard immutable language:
         | "object" is a set of (name, value) pairs; "value" is either
         | object or "data" (like a string, bool etc...); everything is
         | immutable but you can make a copy an object with some
         | attributes changed. There are no concept of "types" -- instead,
         | you define objects with some fields set to NULL (spelled [?] in
         | the paper). There are also a bunch of term defined, like
         | "abstraction", "application", etc.. -- but they all mean "make
         | a copy of an object with some fields changed".
         | 
         | The "twist" is that the language has no functions per se,
         | instead it defines AST-like structure: there is a syntactic
         | sugar that handles things that look like function applications.
         | So when you see:                    stdout "Hello world"
         | 
         | This means "find an object called 'stdout'"; it must have
         | exactly one attribute that was set to NULL ; and make a copy of
         | the "stdout" with that attribute set to value "Hello world".
         | 
         | The "stdout" is what's called "atom", a class which is defined
         | "outside of ph-calculus formal scope". All the actual work is
         | defined via those atoms, which are out of scope. Unfortunately,
         | this means that ph-calculus itself does not define much, and is
         | basically a fancy way to write AST.
        
           | compressedgas wrote:
           | Reminded me of http://soft.vub.ac.be/research/agora/
        
           | bawolff wrote:
           | Interesting given their design criteria is no nulls and no
           | syntactic sugar.
        
           | Joker_vD wrote:
           | And the "Semantics" section straight up reinvents their own
           | flavour of a G-machine... very fancy indeed.
           | 
           | Is there a shortage of existing object calculi that I am not
           | aware of? Even Abadi-Cardelli's calculus can already do just
           | as much, _and_ is also smaller and more concise.
        
           | lfnoise wrote:
           | reminds me a bit of Piccola:
           | http://scg.unibe.ch/research/piccola/
        
       | abeppu wrote:
       | In the "Things we don't tolerate" list, for "classes" they link
       | to a short post which describes a simple use of prototypes with
       | "types" but not "classes" and ends with "Why not?"
       | 
       | Building something can show that an approach is possible, but not
       | why you think it's preferable.
        
       | pharmakom wrote:
       | I wonder how far this is from clojure in practice? Seems to have
       | very similar principles.
        
       | Fellshard wrote:
       | Hmm. I'm intrigued what they come up with. The creator is
       | something of a firebrand, who tends to 'no true scotsmen' other
       | OOP languages. His ideas are interesting, but often seem
       | impractical in other languages. If he comes up with something
       | effective, I suspect it will indeed feel similar to lisp, and not
       | in a bad way. Even what he's showing right now feels similar to
       | Wisp-syntax with an OO twist.
        
         | baryphonic wrote:
         | "OOP" is itself such an overloaded term that a Smalltalk coder
         | and a C++ coder and a Python coder can each say she works with
         | objects, and yet have entirely different design and
         | organization. By formalizing his definition of OO, Yegor (who
         | is a firebrand for sure[0], but says enough interesting things
         | that I've read a couple of his books and several blog posts) is
         | dispensing with "no true Scotsman" fallacies: if he claims
         | language <X> is not OO per his formal definition, we can take
         | it or leave it.
         | 
         | For what it's worth, Alan Kay himself has said things like, "I
         | invented the term Object-Oriented, and I can tell you I did not
         | have C++ in mind." He has declined to formally define what he
         | means, but has said, "OOP to me means only messaging, local
         | retention and protection and hiding of state-process, and
         | extreme late-binding of all things."[1] Even without a formal
         | definition, most languages purporting to be OO clearly fail a
         | common sense interpretation of his criteria. Kay himself
         | mentions Smalltalk and Lisp being the only systems he's aware
         | of that meet his criteria; I tend to think Erlang is
         | spiritually close, though would have to defer to Alan (I find
         | it interesting, too, that the first Erlang VM was written in
         | Prolog).
         | 
         | [0]https://www.yegor256.com/2017/07/18/sexual-harassment.html
         | 
         | [1]http://www.purl.org/stefan_ram/pub/doc_kay_oop_en
        
           | Fellshard wrote:
           | Yep, that's the kind of thing I try to consider in this
           | subject. I think his take is intriguing and distinct enough
           | to possibly have merit, but it's difficult to discuss it
           | directly with the creator because... well, it's hard to
           | discuss benefits and difficulties with a firebrand.
           | 
           | For what it's worth, I suspect Yegor's view is somewhat
           | closer to Erlang as well, given both end up collapsing into a
           | model of both functional purity and message-dispatching, if I
           | understand them both accurately.
        
           | zokier wrote:
           | > Even without a formal definition, most languages purporting
           | to be OO clearly fail a common sense interpretation of his
           | criteria.
           | 
           | Which should be obvious sign that Kays criteria for OO does
           | not match the common usage of the term, and as such not very
           | useful.
        
             | weatherlight wrote:
             | I think that the argument is that even the "common usage of
             | the term" means a lot of different things to a lot of
             | different programmers/computer scientists/etc.
        
       | [deleted]
        
       | nobody0 wrote:
       | Why does this title take up extra line height?
        
         | detaro wrote:
         | Because of the  symbol taking more space.
        
           | [deleted]
        
       ___________________________________________________________________
       (page generated 2021-09-06 23:01 UTC)