Live data from Hacker News

Phoenix 1.0

phoenixframework.org

221–228 of 228 posts

Re: Phoenix 1.0

#221

Earlier quoted context omitted.

I concur -> In computer programming, homoiconicity (from the Greek words homo meaning the same and icon meaning representation) is a property of some programming languages in which the program structure is similar to its syntax, and therefore the program's internal representation can be inferred by reading the text's layout. Wiki

Every language's syntax internal representation can be inferred by reading it's text layout. It's what parsers do and people can, too. How "similar" internal representation needs to be to its textual version to be homoiconic is subjective. In Erlang an expression: 2+3. yields this AST: {op,1,'+',{integer,1,2},{integer,1,3}} You can strip line and type annotations (you could also easily add them to the Prolog example…

Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that.

I don't find it particularly subjective, it's just what it means. According to what you're saying any language that can be parsed and manipulated by the language is homoiconic, since the AST can be represented by types available in the language, no?

Re: Phoenix 1.0

#222
post #77

Earlier quoted context omitted.

Agreed. One of the many things that makes Phoenix/Elixir great for us rails/ruby refugees is that it's built by other rails/ruby refugees. In many ways, we have all the good things that our old masters DHH trailblazed with rails, but at the same time, very little of the mess that also came with the trail-blazing. That being said, I do miss active_support though; Elixir's utility libraries (fox, pipe, croma, etc.) doe…

I downvoted you and I wanted to say why: 1) Referring to DHH and others as a "our old masters" instinctively bothered me. 2) While I appreciate that Elixir and Phoenix have Rails connections and can learn from it, I'd prefer it not become just a place for Rails refugees where it turns into a huge circle jerk about how Rails is terrible and Phoenix is great (which happens all too often in communities). Other than that…

I appreciate the honesty here, but don't see how this is a reason to downvote his comment. His comment contributes meaningfully to the discussion.

Re: Phoenix 1.0

#223

Earlier quoted context omitted.

Every language's syntax internal representation can be inferred by reading it's text layout. It's what parsers do and people can, too. How "similar" internal representation needs to be to its textual version to be homoiconic is subjective. In Erlang an expression: 2+3. yields this AST: {op,1,'+',{integer,1,2},{integer,1,3}} You can strip line and type annotations (you could also easily add them to the Prolog example…

Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that. I don't find it particularly subjective, it's just what it means. According to what you're saying any language that can be parsed and manipulated by the language is homoiconic, since the AST can be represented by types available in the language, no?

> Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that.

Literal datatype.

And please, prove it to me that "Erlang isn't that". My examples above indicate quite clearly that yes, it is.

> I don't find it particularly subjective,

I was referring to the word "similar" which appeared in the definition of homoiconicity given by flackjap.

> since the AST can be represented by types available in the language, no?

Yes, if the datatypes used in AST representation have literal forms in the language. No otherwise.

Re: Phoenix 1.0

#224

Earlier quoted context omitted.

Yes, there is [1]. That's the reason Firefox is Firefox (Phoenix -> Firebird -> Firefox). [1] http://www.firebirdsql.org/

I believe that's the joke! I usually never mind when projects have duplicate names, but c'mon, "Phoenix"?! Zero points for creativity there - I sure wish there were more things in history than rose from the ashes ;)

Oops... whoosh

Re: Phoenix 1.0

#225

Earlier quoted context omitted.

The Devise gem does that for free. I remember me coding it in my first Rails application so many years ago and I'm not keen to go back to it: it feels like wasted time. Phoenix didn't have it one year ago and it's sad to learn that it doesn't have it yet. Somebody will write it sooner or later because it's almost core functionality of a registration and authentication system.

Its actually pretty simple to implement on your own. I am not big of device. I feel it does too much magic. It should have been just a api layer and not touching views.

It's simple to write a password-based auth system. Then you must clear session appropriately.

Then you must create the login page.

Then the controller for authenticating. And then you need to ensure that the flow works with a test.

Then you need the email that actually activates the account, with the activation hash. So now you're setting up a mailer system, which Phoenix does not have by default.

Then people will want to recover passwords. So you need to write the logic for that. Oh, and the controllers and views. And routes.

And of course, you need to hash the password using some kind of encryption. Excrypt, comeonin, what have you. Choices choices choices.

You'll need a plug to act as the bouncer for your routes too, so nobody gets in where they shouldn't. So you'll have to write that.

You have to end-to-end test this, of course. And probably, if your business depends on it, get a couple other people to review the security of your system.

Simple. And takes a long time.

HTTP is pretty simple, but we use frameworks. SQL is pretty simple too, but we use Ecto now.

It's simple in its pieces, but I really don't wanna do all that work on every app. I'm lazy.

Re: Phoenix 1.0

#226

Earlier quoted context omitted.

Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that. I don't find it particularly subjective, it's just what it means. According to what you're saying any language that can be parsed and manipulated by the language is homoiconic, since the AST can be represented by types available in the language, no?

> Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that. Literal datatype. And please, prove it to me that "Erlang isn't that". My examples above indicate quite clearly that yes, it is. > I don't find it particularly subjective, I was referring to the word "similar" which appeared in the definition of homoiconicity given by flackjap. >…

You claim any language that can represent its AST using that language's literal datatypes is homoiconic?! No. I can represent an AST in array literals in essentially any language, and quite a few using object/hash notation. That alone does not make a language homoiconic. See, for example, the lengthy thread here: http://c2.com/cgi/wiki?HomoiconicExampleInJava

Re: Phoenix 1.0

#227

Earlier quoted context omitted.

> Homoiconicity specifically means that the primary representation of the language is a datatype in the language itself; Erlang isn't that. Literal datatype. And please, prove it to me that "Erlang isn't that". My examples above indicate quite clearly that yes, it is. > I don't find it particularly subjective, I was referring to the word "similar" which appeared in the definition of homoiconicity given by flackjap. >…

You claim any language that can represent its AST using that language's literal datatypes is homoiconic?! No. I can represent an AST in array literals in essentially any language, and quite a few using object/hash notation. That alone does not make a language homoiconic. See, for example, the lengthy thread here: http://c2.com/cgi/wiki?HomoiconicExampleInJava

There's another constraint, as seen in the definition of homoiconicity from Wikipedia. I'll paste it once again:

> In computer programming, homoiconicity [...] is a property of some programming languages in which the program structure is similar to its syntax, and therefore the program's internal representation can be inferred by reading the text's layout. If a language is homoiconic, it means that the language text has the same structure as its abstract syntax tree (i.e. the AST and the syntax are isomorphic). This allows all code in the language to be accessed and transformed as data, using the same representation.

As I noted, a similarity is subjective, but I never claimed that it's not needed as a criterion. So, what I claim is that homoiconicity happens when the AST representation consists of only literal datatypes of the language AND the AST structure is "similar" to the original code.

That's it. And also:

> I can represent an AST in array literals in essentially any language

I doubt it, but that's irrelevant. Had you done it you'd essentially reimplement the language of your choice and then we're not talking about that language in general anymore, but about your implementation. What you say here is that "every language can be made homoiconic given appropriate AST implementation". And that's probably true, although I suspect it gets too hard to do in practice for more complex syntaxes.

May I ask where are you getting your strong convictions about homoiconicity from? If you read the Wiki page you'll notice the use of less than precise words, like "similar" or "Languages which are considered homoiconic include" and so on. The concept itself is not as clear-cut as you seem to believe and it's mostly defined by examples.

Also, you still didn't provide a convincing argument that Erlang is not homoiconic; you only claimed that "it isn't" and moved on.

EDIT: as an example of how subjective homoiconicity is take a look at Julia. Listed on the wikipedia as homoiconic, here are the details: http://docs.julialang.org/en/latest/manual/metaprogramming/ - if Julia is homoiconic, then Erlang and Elixir are too. And Haxe, and Dylan. Are they? I don't know, I'm not going to argue about this. As I said, homoiconicity is only interesting as a way of simplifying macro creation; any more discussion is honestly useless to me.

Re: Phoenix 1.0

#228
post #189

Earlier quoted context omitted.

> NPM and RubyGems are casualties of people seeking > open source fame and I hope we can avoid that in Elixir. No, they're casualties of people actually using the platform, the platform's low publishing barrier, and the ecosystem's preference for focused libraries over monolithic bouncy castles. Rallying around one library sounds cool until you see that the top three competing solutions in another ecosystem each have…

Yeah because those 20+ half-baked MongoDB drivers on npm are totally better than emongo (Erlang) and mongo (Elixir).

I don't use Mongo, but I don't see any competitive alternatives to node-pg.
Post reply on HN