Slashdot Mirror


Prothon - A New Prototype-based Language

Ben Collins writes "Prothon is a new industrial-strength, interpreted, prototype-based, object-oriented language that gets rid of classes altogether in the way that the Self language does. It uses the sensible, practical syntax and add-on C module scheme from Python. This major prototype improvement over Python plus many other general improvements make for a clean new revolutionary breakthrough in language development. Prothon is simple to use and yet offers the combined power of Python and Self. Check out the first public pre-alpha release at prothon.org."

39 of 630 comments (clear)

  1. Pre Alpha Release? by Thanatopsis · · Score: 4, Insightful

    A pre alpha release really isn't newsworthy. Is this some one's pet project? I wasn't aware Python was broken.

    1. Re:Pre Alpha Release? by seaswahoo · · Score: 5, Funny

      Well, it would be newsworthy if it were a pre-alpha release of Duke Nukem Forever.

    2. Re:Pre Alpha Release? by Frymaster · · Score: 5, Funny
      A pre alpha release really isn't newsworthy. Is this some one's pet project?

      this language doesn't just use prototypes... it is one.

    3. Re:Pre Alpha Release? by FortKnox · · Score: 5, Insightful

      A pre alpha release really isn't newsworthy. Is this some one's pet project?

      That's what it sounds like to me.
      Someone has an idea, makes a sourceforge page for it, gets some developers, writes up his ideas full of marketspeak. What happens to it? About 95% of the time, it dies a long, slow death.
      That's pre-alpha, folks! I'll be happy to look at it when it reaches 1.0, but until then, I'm playing the odds.

      I wasn't aware Python was broken.

      Perl wasn't broken when Python was made, right? Adding another language never harms anyone, really. If it proves to be powerful, people will use it. If it proves to be clean and easy to understand, people will use it as a learning tool. If it doesn't offer anything better than any other language, it will die. Its just the evolution of coding languages.

      Hell, if everyone followed the philosophy of "well, [programing language] isn't broken, why make another." We'd all be programming in assembly... or worse, bytecode.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    4. Re:Pre Alpha Release? by Indras · · Score: 4, Funny

      Well, it would be newsworthy if it were a pre-alpha release of Duke Nukem Forever.

      Yes, hell freezing over and the end of all mankind would be newsworthy, wouldn't it?

      --
      The speed of time is one second per second.
  2. Pity about the name by Eunuchswear · · Score: 5, Funny

    Sounds like a korean car.

    --
    Watch this Heartland Institute video
    1. Re:Pity about the name by Earle+Martin · · Score: 5, Funny

      Maybe it's a cunning anagram of "hot porn".

    2. Re:Pity about the name by eclectro · · Score: 4, Funny

      Maybe it's a cunning anagram of "hot porn"

      Thanks a lot dude. I'll never be able to use "prothon" without thinking of "hot porn" now.

      You pretty much have managed to kill it right out of the box.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    3. Re:Pity about the name by tverbeek · · Score: 4, Funny
      Thanks a lot dude. I'll never be able to use "prothon" without thinking of "hot porn" now.

      {puzzled} You say that as if it were a bad thing.

      --
      http://alternatives.rzero.com/
  3. How can they... by ThrasherTT · · Score: 5, Insightful

    call it "Industrial-Strength" if it's "pre-alpha?"

    --

    All Your Memory Are Belong To Java
    1. Re:How can they... by O2n · · Score: 5, Funny

      call it "Industrial-Strength" if it's "pre-alpha?"
      Microsoft gets away with this every time....

  4. Here we go.... by Anonymous Coward · · Score: 4, Interesting

    with the "witty" names again. Anyway, can someone explain to me how eliminating classes is better? I thought that implementing classes, the OOP approach, was the better way to go.

    They don't really explain why their way is better. They just state it as though it was a matter of fact.

    Make your vote count

    1. Re:Here we go.... by orangenormal · · Score: 5, Interesting

      Prototype languages still hold many of the OO concepts, but objects are created directly. That is, a "blueprint" approach (i.e., the class) is not used in the creation of objects. Inheritance still works by cloning and modifying existing objects. Although this makes sense in some ways (ideas like the Singleton pattern fit more nicely in this paradigm), in reality prototype languages gain features that make them more and more class-like. I'm not a big fan, personally.

    2. Re:Here we go.... by Eagle5596 · · Score: 4, Insightful

      So why do you assume OOP is the better way to go? I don't assume that OOP is the better way to go. I know it is from experience. I work with a lot of OPC (other people's code for those who don't know the term), and let me tell you, working with objects is about 10x easier for maintence, and for adding functionality. OOP isn't an excuse to code poorly though, I will take non-OOP that is well written over OOP that is poorly written, however as most of the code I deal with is poorly written, the OOP does make it easier.

      OOP enables you to easily swap out modules, or replace existing code. As long as you know the inputs and outputs of an object, it can be seemlessly removed for a newer version. This makes maintence much easier, and so long as public/private/protected conventions are followed, it can allow for some really smooth upgrades.

      IMHO inheritance is an overrated feature of OOP, I primarily like it because it forces people to work in a black box model, which makes the whole problem of updates and bug fixes 100x easier for the person who has to deal with your otherwise crappy code.

  5. p fixation? by Anonymous Coward · · Score: 5, Funny

    What's with all these languages that start with 'p'? perl, python, php, not to mention good old pascal, and now prothon. Is there a joke here that I'm missing?

  6. Shhhh... by spacefight · · Score: 4, Funny

    Prothon is a new industrial-strength, interpreted, prototype-based, object-oriented language

    Haven't seen so many buzzwords in one sentence for a long long time...

    1. Re:Shhhh... by fredrikj · · Score: 4, Funny

      An even better piece of buzzwords, though fabricated, from the TUNES FAQ:

      A proven 32-bit cutting-edge state-of-the-art industrial-strength Y2K-compliant zero-administration plug-and-play industry-standard Java-enabled internet-ready multimedia professional personal-computer Operating System that is even newer and faster yet compatible, with a user-friendly object-oriented 3D graphical user interface, amazing inter-application communication and plug-in capability, an enhanced filesystem, full integration into Enterprise networks, an exclusive way to deploy distributed components, seamless network sharing of printers and files.

      A work of art, except that it doesn't have "XML" in it somewhere.

  7. Bondage by spellraiser · · Score: 5, Interesting

    This is taken from the Prothon Description

    Like Python, Prothon uses indentation to control the block structure of the program instead of block/end or {}. However, Prothon only allows tabs for indentation. Any space in an indent will cause an error.

    Classic bondage-and-discipline. Why oh why is this so ??

    --
    I hear there's rumors on the Slashdots
    1. Re:Bondage by Just+Some+Guy · · Score: 4, Informative
      I can think of two good reasons:
      1. If you're using indentation for structure, then it's horribly confusing to allow both tabs and spaces. How many spaces is a tab worth? You could add a "tabsize=" variable to the core language, but you have to be able to parse a file before you can start evaluating it, so that would necessarily have to be an ugly hack.
      2. An (old) Python topic-of-heated-discussion was the relative merit of tabs vs. spaces. Setting one as the standard avoids the whole issue and lets everyone get back to work.
      My only gripe is that out of the two choices, they picked the wrong one <ducks>.
      --
      Dewey, what part of this looks like authorities should be involved?
  8. Re:Uh by congaflum · · Score: 5, Insightful

    Of course we need more programming languages. That is how we learn how to make programming languages better.

    Sure, only a small number of languages become popular in the end. But that doesn't mean the unpopular ones don't have academic value.

    Cheers.

  9. Why is there only one database access language? by Anonymous Coward · · Score: 5, Interesting

    There are sooo many general programming languages but only one database access languages: SQL? SQL is so old, it hurts. It's basically COBOL.

    Ok, there is one additional database access language I know of: NewSQL (http://newsql.sf.net).

    But it seems nobody is really interested in database access. And everybody is interested in all kinds of general programming language. Why is that?

    1. Re:Why is there only one database access language? by jrexilius · · Score: 4, Insightful

      Thats a good question, but I would say that because in general (arguably because SQL is so limited) there has been a seperation of data storage and application logic paradigm. Its similar to why filesystems dont have lots of complex logic constructs built in to them.

      You might question the eveolution of how much we push into the platform level though. For instance the hot libraries/tools people are playing with are things like object serialization packages, cheap DB replication, etc. These are places where application space is trying to address lack of evolution in data storage space and might be good candidates for new storage interfaces.

      Just a thought..

    2. Re:Why is there only one database access language? by Mr.+Slippery · · Score: 5, Interesting
      There are sooo many general programming languages but only one database access languages: SQL? SQL is so old, it hurts

      Arabic numbers are old too, but I don't see anyone proposing to change them.

      SQL is an English-like representation of relational calculus. Relational calculus has not, and is not going to, change significantly. When the problem is solved well, there's no need to change the solution.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
  10. Re:Maybe they should write a new webserver by kyjello · · Score: 5, Funny

    They would if it wasn't easier to do in python.

    --
    kyjello is too damn smooth to make a signature.
  11. even better by swagr · · Score: 5, Interesting
    --

    -... --- .-. . -.. ..--..
  12. Like school in the summer time by Sloppy · · Score: 4, Informative

    Found a little example code inside the tarball, that shows what they mean by no classes:

    Emp_proto = Object()

    with Emp_proto: .name = ""

    def .__init__(name): .name = name .hello()
    return .

    def .hello():
    print "My name is:", .name

    Emp_proto.hello()
    emp = Emp_proto("Jim")
    emp.hello()

    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  13. Re:YANISL: Just What We Needed by cratermoon · · Score: 5, Funny

    A new language is here! A new language is here! I needed something to go between "Perl" and "Python" in my alphabetical index of languages.

  14. When things come together, they combine ... by Chromodromic · · Score: 4, Insightful
    Anytime a programming language "combines" the power of X with the simplicity/power/convenience of Y, what it really means is, "Here's a new set of compromises and we're calling it this, but the marketing guys are making us say that it's a new way of slicing bread."

    Bottom line, someone wanted Python with prototypes. I'm not sure that prototyping -- creating objects from other existing objects by copying, essentially making inheritance a "first class" consideration -- is an analogy that's going to truly redefine the way I look at programming. Or let me put it this way, I'm not at all sure that the benefits of prototyping are going to make me want to restructure -- yet again -- everything I know about programming so far. I mean, after a certain point, programming is a job and I have to produce, not just theorize all the time about new approaches.

    Also, judging from Sun's tutorial on Self, it doesn't seem ready for primetime, so I'd be a little edgy about "Prothon".

    Prothon. God.

    I dunno. This may seem curmudgeonly, but it is, after all, yet ANOTHER language ... Sigh.

    --
    Chr0m0Dr0m!C
  15. Not 'instrustrial strength' by Chmarr · · Score: 5, Insightful

    I'm a bit of a 'language lawyer', so new languages that try to solve problems in interesting ways always interests me. So... I decided to give it a good reading. I got turned off IMMEDIATELY as I saw the following text:

    "Unlike python, there is no 'global' keyword. Any variable name starting with a capital letter is global."

    (Taken from memory... the prothon site is a bit slow at the moment, for some odd reason ;) )

    That is NOT the sign of an 'industrial strength' language.

    1. Re:Not 'instrustrial strength' by Just+Some+Guy · · Score: 4, Insightful
      I refuse to even consider ANY language that is whitespace sensitive

      It's never cool to brag about an unwillingness to learn something new. No matter what other good things you might have heard about Python, you refuse to even try to get past the formatting? That's really sad.

      Question to mods: what part of that comment justified "informative"?

      --
      Dewey, what part of this looks like authorities should be involved?
  16. Self, Python, and Java by jfengel · · Score: 5, Interesting

    Yeah, it's a lot like Self, mixed with Python syntax. Self had a lot of interesting ideas. It never really got out of the starting blocks, but some of its most important ideas in dynamic compilation went on to be included in the Java hotspot compiler.

    Personally, I prefer a bit more bondage-and-discipline in my languages. That's because I like having the compiler tell me what I'm doing wrong as much as possible. It's a side effect of the environments in which I tend to work, with multiple people working on the same code. Strong typing is an important contract in such an environment. But it has a lot of downsides, as every perl and python programmer knows.

    Oh, and dude, if you're going to submit your own damn web site to Slashdot, try getting a sturdier web server first.

  17. If it's nae Lisp, it's Crrrrrrap by fuzzy12345 · · Score: 4, Insightful
    Sorry kids, I've had my epiphany.

    Is it dynamic (can I define functions at runtime)? Is it compiled? Can I easily write code that manipulates code? Are functions first class objects? Can I extend the language seamlessly?

    Some new languages are interesting, but most are built by people who have used and understood far too few of the current ones.

    --

    Everybody's a libertarian 'till their neighbour's becomes a crack house.
  18. The good and the bad by XNormal · · Score: 4, Insightful

    The good parts are the implementation: multiple interpreters (no globals), stackless, gc running in separate thread and generally a clean implementation from scratch.

    The bad part is from a language design point of view it's a hodge-podge of small yet significant changes from Python, almost none of them, IMHO, an improvement over Python. Those that may be considered a slight improvement are hardly worth breaking compatibility for.

    Significant case? Another type of comment? for i in 7 ? a differnt keyword to define generators? Return self by default? removal of class statements for javascript-like object orientation? WTF?

    The Python implementation could definitely use an overhaul. The language itself has a few minor warts but strikes a fantastically well-balanced sweet spot that will be difficult to beat. I just can't see the real justification for these changes other than "because I can".

    --
    Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
  19. Re:YANISL: Just What We Needed by Hater's+Leaving,+The · · Score: 4, Informative

    Not improved - just as bad:

    "Like Python, Prothon uses indentation ..."

    Oh joy.

    THL.

    --
    Keeping /. cynic density high since the fscking Kwhores/trolls arrived.
  20. A plea to all up-and-coming language designers by alispguru · · Score: 4, Informative
    Before you go off and try to code up the Next Big Thing, please do all of us a favor and learn a little bit about Lisp.

    Don't learn about it from your officemate, or your college instructor, especially if they say they haven't used it in over ten years. You wouldn't believe the opinions of someone who learned C from K&R without upgrading their knowledge, would you?

    Instead, start from places like the ALU web site or Cliki or Paul Graham's Lisp FAQ.

    If you do this right, you will learn that computer languages:

    are not inherently fast or slow - implementations are fast or slow, not languages

    can be both dynamic and have good performance

    can be cross-platform without swallowing POSIX whole

    can have multiple inheritance without damaging your brain

    can be object-oriented without being object-obsessed

    If you like, you can quit as soon as you understand how static scoping and closures work - at least that way you will avoid the primary mistake in pretty much every recent scripting language.

    There is a small risk you will become a SmugLispWeenie by doing this, so be forwarned.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  21. Re:Because SQL works by Qzukk · · Score: 4, Insightful
    how is sql in any way inadequate?

    Ok, lets say you have an invoice system that maintains "customer"s, "bill"s, and "payment"s in seperate tables. The relationships are as follows: One customer to many bills and many payments. A seperate table "paytobill" (with an amount field) is used to link bills and payments as some customers may make a single payment covering several bills, or several payments to cover a single bill (like a payment plan).

    Now, give me a report showing every customer, and the most recent bill that each customer owes money on (if they have any), and how much they owe. Using strictly these tables (ie no fields that are updated by a trigger) it is incredibly hairy. Your choices are pretty much to execute a query on "paytobill" inside a loop from "customer left outer join bill", or to do something really hairy like this (postgres syntax) (we'll assume that bill.id is ascending:
    select c.name, bq.billdate, bq.cost-coalesce(pq.amount,0) as unpaid from customer c left outer join (select b.customerid, b.billdate, b.cost from bill b where b.id=(select max(bm.id) from bill bm where bm.customerid=b.customerid and b.paid='f') ) bq on bq.customerid=c.id left outer join (select b.customerid,SUM(pb.amount) as amount from paytobill pb join bill b on pb.billid=b.id where b.id=(select max(bm.id) from bill bm where bm.customerid=b.customerid and b.paid='f') group by b.customerid) pq on pq.customerid=c.id
    Not pretty, is it? Now, look at how that could be done with less language and more readability by adding a single keyword and slightly redefining the syntax:
    select c.name, b.billdate, b.owes-coalesce(sum(p.amount),0) as unpaid from (customer c LIMITED left outer join (bill b LIMITED left outer join paytobill p on p.billid=b.id GROUP BY b.id, b.billdate, b.owes) on c.id=b.customerid ORDER BY b.billdate DESC LIMIT 1)
    Here, its clear that we're joining "bill" and "paytobill" and collapsing that table immediately to generate sum(p.amount). Then, we order this collapsed table on date, and left outer join against "customer", BUT we only take one row from the collapsed table for each customer (if it speeds the join, we could even ditch those unused rows now to further shrink the table). Drawbacks include the use of () to clarify what grouping and limit we mean. Even though the LIMITED keyword could mean that the next GROUP BY/LIMIT keyword belongs to the join, what if both were used, without a WHERE clause to indicate where the joins ended and the main query began?

    The query planner would have to be able to identify the request for SUM(p.amount) as being related to the GROUPed limited join. The planner would then create the intermediary table and calculate the aggregate values on that table using the given group by. Then the query planner would order the intermediary table and join it with the customer table, selecting from zero to the limit number of right-hand rows for each left-hand-row The syntax above makes it fairly clear what the query planner should be doing.

    The command in SQL would involve a nested loop [select max(...)...] (two, if the planner wasn't smart enough to recognize that the two copies of it are identical, which most won't be since they are in seperate branches of a left outer join) (it's possible that a brilliant query planner might be able to make the jump and create an intermediary table of <bill.customerid,MAX(bill.id)> for reference in both branches of the query). In addition, unless you have a brilliant query planner, you'll end up working with potentially very large intermediate tables.
    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  22. There's another name for Prothon: Python by Lulu+of+the+Lotus-Ea · · Score: 4, Informative

    We already have perfectly good prototype-based programming in Python. Do a search for "metaclass programming in python" for links to my articles on this topic. You can do -everything- with Python metaclasses (which isn't to say you -should-).

    But actually, prototype programming is even simpler:

    new = old.__class__(init, args, here)

    Just what 'old' is is determined at runtime. And if you like, you can poke around at 'obj.__bases__' to futz with inheritence.

    Not having read my _Charming Python_ articles isn't really a sufficient reason to create a new programming language.

  23. Ahhhh, Lisp -- and its true believers! by melquiades · · Score: 4, Insightful
    Yes, you too can become a fanatical Lisp user! Just trawl for any online discussion of any programming langauge that is not Lisp, then post using the following handy form:

    Derogatory or condescending salutation. Quasi-religious statement of love for Lisp.

    Laundry list of several nifty Lisp features. (It doesn't really matter which ones.)

    Implication or outright statement that every feature in programming language in question has already been implemented in Lisp. Subsequent dismissal of language in question.

    Remember, in writing your post, it is essential that you adhere to the following guidelines:
    • Never show any respect for a non-Lisp language.
    • Never admit the usefulness of new experiments, or of personal exploration.
    • Never contribute concrete, constructive suggestions to the designers or users of any other language.
    • Never, never think outside the Lisp box.


    (Disclaimer: I like Lisp. Actually, I love Lisp. It really, truly is incredibly awesome. It's just Lisp users that drive me crazy.)

    <ducks REALLY low>
  24. Re:Because SQL works by hey! · · Score: 4, Insightful

    Well, for one thing your indenting sucks which makes any piece of software hard to read.

    For another thing, your design is unsound from an accounting standpoint. A sound design requires that payments are explicitly applied to bills in our record keeping system whether it is electronic or paper. It's the old debits and credits thing. Your accounting records should not use some kind of magical algorithm to figure out which payment record goes which which bill and then use a separate maguic table to override that logic. Every change in an acount/bill/payment status should be explicitly spelled out in records in a transaction table. These records are either filled out at the explicit directions of a human or by created by an algorithm -- it doesn't matter. The change in the bill's balance needs to be be explicitly recorded.

    Given this design, the payment table in your query is totally superfluous. Everything we need to know is in the paytobill table. What you are asking for is not that hard (for an expert):

    select customer.custId,
    bill.billId,
    billAmt - coalesce(sum(payToBill.applyAmt),0)
    from customer left outer join
    bill on bill.custId = customer.custid left outer join
    paytobill on paytobill.billId = bill.billId
    where
    bill.billdate =
    (select max billdate from bill
    where bill.custId = customer.custId)
    group by customer.custId, bill.billId

    Which is much less nasty than your SQL. Granted, SQL programmers don't always have the ability to work with sound schema designs; on the other hand, it's always possible to create designs that are hard to use.

    I'm not saying SQL couldn't be improved. It also needs the ability to compare anonymous tuples with tuples returned by a subquery -- only allowing scalars with the "=" operator is a huge limitation to the working SQL programmer.

    Also, the standard needs to be a lot more stringent, and there should be tough conformance tests. The Microsoft SQL Server, for example is a disgrace -- it doesn't allow alias references in expressions for one thing, and has truly horrible bugs in prepared query variable binding.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.