Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: aXML vs TT2

by anneli (Pilgrim)
on Oct 21, 2011 at 08:59 UTC ( #932846=note: print w/replies, xml ) Need Help??


in reply to Re^2: aXML vs TT2
in thread aXML vs TT2

Indeed; it's one failing of Lisp, in a way: too much homoiconicity is not necessarily a good thing -- you spend much of your time trying to work out where are the function calls, what are the arguments. Macros don't help, as you need to look at the callee, work out whether it's a function or macro, and in the case of the latter, whether or how it evaluates its arguments, in order to know if or when side effects will occur!

Replies are listed 'Best First'.
Re^4: aXML vs TT2
by davido (Archbishop) on Oct 21, 2011 at 16:28 UTC

    Well, Lisp has enough merit to have survived literally for a handful of decades despite its aggravating characteristics. I don't know enough about aXML to know whether it would support currying, lambda functions, and other higher order utility that gives Lisp enough value to overcome the issues caused by blurring the distinction between data and code.


    Dave

      I just had a rummage through some examples of lisp and was instantly revolted by it. Whilst I can see why you might think aXML is related to lisp, but the apparent similarity is superficial.

      Also I just looked up this "currying" that you mentioned and I have no idea what that is all about.

      As for lambda functions, I do recall a degree holding friend of mine mentioning that term way back like 5 years ago when I was first playing around with the original aXML parser, however I still haven't figured out what she was on about.

      Your right about aXML blurring the line between data and code, infact it doesn't just blur that line so much as erase it entirely. In aXML data is code and code is data there is no distinction.

      That may ring alarm bells to a classically trained computer scientist, however I would stress that due to the structure of the syntax which is only marginally harder to understand than say HTML5, there is no problem. You can consider aXML as a datacode programming language for controlling servers and browsers.

      After a very short and shallow learning curve the systems merits soon become clear.

        I wasn't really comparing it to Lisp so much as considering that Lisp, which does blur the distinction between data and code has managed to be both successful and revolting (perhaps mildly) at the same time. Mostly successful in that it has survived longer than just about any programming language, and has contributed (and continues to contribute) powerful concepts to the programming world. Recursion, currying, lambda functions, ...tools of functional programming leaked out of Lisp into other realms because they were found to be so useful.

        So what I was getting at is that even though Lisp has a bad habit of making it difficult to discern code from data, it has sufficient strengths to have remained peripherally successful for almost 50 years, both in academia, among the "smug few", and even in some real-world applications. It remains to be seen whether aXML has sufficient merit and strengths to make people want to use it even though it also leaves the bad taste of intermingled code and data in the mouths of those who understand why that's a serious drawback. For those who don't understand the concerns, the biggest barrier to entry will be figuring out how to deal with Perl (which seems more complex than the audience that aXML targets), and Plack/PSGI (which requires a little more fortitude still to get going). The "Low Rent" languages like PHP are successful because the barriers to entry are low. If you hitch aXML to Perl's wagon and add the requirement of PSGI/Plack you price yourself out of the lowest common denominator market of those the language is designed for.

        As for why it's dangerous to blur the distinction between code and data, there are several schools of thought. On the one hand, Lisp, and "functional programming" in general treats functions like first class objects, which is a fancy way of saying that they treat functions as the data that can be processed, shaped, and observed. But there is still a strong respect in many versions of functional programming for what constitutes user data, and what constitutes code data.

        If outside data is permitted to become syntax, outside data gains the same control that primary code has. Namespace collisions and code injection become serious security concerns.

        Perl has taint mode for a reason; to help programmers assure that they never cross the line. It's not infallible, but it's a big step in the right direction when it comes to helping savvy programmers keep track of where that line is. It's easy enough to abuse. But it's a good tool.

        You're proudly stating that erasing the distinction that taint mode seeks to enforce is a good thing. And I don't know enough about aXML to argue; I'm sure it makes simple code really easy to implement. But it is probable that it's also making simple abuses easy to implement and hard to keep track of, much less prevent. Dijkstra said, "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration" I'm concerned that those who cut their teeth on something like aXML will not only fall into that category, but also into the category of programmers who has no concept of what constitutes secure or unsecure coding practices.

        If Lisp does seem interesting to you (It teaches a lot of great lessons in the science of computing), meet Structure and Interpretation of Computer Programs. No, I haven't finished it yet. But every chapter makes me feel wiser (in my own eyes, of course).

        That brings me to another topic that I've been meaning to present to you but have avoided until now. I've seen you mention before that you feel that CS degree holders look down upon you with a sort of academic snobbery. I have to take this opportunity to mention a conversation I had a few days ago while sitting down to a social dinner with several successful programmers who work for a well known dot com. We talked for an hour or so, and at one point the topic of education did come up (it was I who brought it up as I was seeking suggestions for a Perl class I may be teaching in the CS department of a local college).

        I apologize now if I've mixed the conversation a little, but I'm sure they wouldn't mind. One of the programmers sitting with me said he had an engineering degree, started working on embedded systems, and migrated to Perl (self-taught), which is now his career. Another had a degree in Japanese studies with an emphasis on historical monastic groups in Japan. He also taught himself Perl, and is programming for a living. A third when asked "What did you study?" replied "I didn't." I would disagree; he studied a lot, but maybe not formally. A well known author whom most of us have read and whom I respect a great deal doesn't seem to list a college degree in his credentials. Larry Wall studied Linguistics. Several monks here studied mathematics. And I studied Economics (ok, I took a bunch of CS classes before changing my major to Econ.).

        I think there's no reason to let your education be a reason to feel picked on. People here tend to look at what is being said (and how it's being said) a lot more than what degree you have. You don't need a Computer Science degree to learn about higher-level concepts. A formal education may nudge you in the right direction, but honestly, the programmers whom I respect the most have risen far above whatever their college education provided them. A fresh CS degree holder who did the minimal amount of work to get A's and B's is only at the start of the road toward having a real brain. And that road doesn't have to start in a CS degree program for someone to find his way to mastery.

        I really have to qualify all of this by saying that I don't feel I've arrived anywhere past the second fill-up and oil change yet. I'm constantly amazed at how broad the experience and deep the wisdom of many of the monks here is. But if there's one thing I do have, it's a respect for the learning process regardless of how participants with sincerity tackle it. But I don't feel that not having a CS degree puts me in a position of being looked down upon. I feel welcome here 95% of the time, and that last 5% is my own fault. ;)


        Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932846]
help
Chatterbox?
[Corion]: Mhhmmm - https://sod.pixlab .io/ looks really interesting for embedding with Perl (XS), but they don't have any kind of free model available and the cheapest pretrained model costs EUR 40 :-(
[Corion]: Maybe I should mail them to find out if they can provide me a "hotdog / no hotdog" model for developping the XS bindings. It would be nice to have a self-contained XS library for applying models to data. Or maybe I should look at TensorFlow, which can...
[Corion]: ... at least be trained by me, instead of relying on a vendor
[Discipulus]: complex and interesting
[Corion]: Discipulus: My hope would be that you can install the module from CPAN, download a model, and get image descriptions/ object detection within half a day, which would be great :)
[Corion]: But it seems that at least for that library, this won't work. But maybe the TensorFlow people have made pretrained model data available, and my task is then to repackage the TensorFlow C API and an example into a proper XS file :)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-06-18 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (109 votes). Check out past polls.

    Notices?