Live data from Hacker News

Replacing Python

roscidus.com

141–144 of 144 posts

Re: Replacing Python

#141
post #140

Earlier quoted context omitted.

I was under the impression that using a class (with `__slots__` set) or a tuple is generally more performant than using dictionaries. At least, I assume that's why he didn't mention dictionaries.

The attributes of an object (and its class) are generally stored in a literal dictionary, so it's unlikely that a class will be more performant. What a class buys you is behavior and a semi-defined interface.

Uhh... Did you not see my parenthetical reference to `__slots__`? See this SO post[1] for more details.

[1] - http://stackoverflow.com/questions/472000/python-slots

Re: Replacing Python

#142
post #140

Earlier quoted context omitted.

The attributes of an object (and its class) are generally stored in a literal dictionary, so it's unlikely that a class will be more performant. What a class buys you is behavior and a semi-defined interface.

Uhh... Did you not see my parenthetical reference to `__slots__`? See this SO post[1] for more details. [1] - http://stackoverflow.com/questions/472000/python-slots

Whoops! I could've sworn that said "without", sorry :)

Though I'm not sure `__slots__` actually saves any time, as it's really a space optimization. I've tried it before for hot code and even seen very slight (probably not significant) slowdowns.

Re: Replacing Python

#143

Earlier quoted context omitted.

Generically http://en.wikipedia.org/wiki/Pattern_matching And as for a language / call semantic look at Erlang for what actual pattern matching looks like.

That doesn't contradict the use of pattern matching in OCaml.

Both the OA and myself are talking about Python.

Re: Replacing Python

#144

Wonder if he looked at Nimrod. On paper that is a language that would both fit his needs and would not be a far leap from his current Python implementation.

When I looked at Nimrod it seemed very raw to me: REPL malfunctions and crashes, the whole language seems to be more an enthusiast effort than a production-quality tool. Rust is very raw too, but it already looks pretty solid.

Nimrod by default compiles to C. Its REPL is just an extra feature which as of right now is not stable because few people use it. It for example doesn't even support the FFI currently. As for whether Nimrod is production quality, I would say yes. The compiler is written in Nimrod which is impressive in itself. I have written many projects in it already and even though the compiler is still not at 1.0 the projects continue to build with no (or very little) errors between new compiler versions. Examples of my nimrod projects: an IDE (https://github.com/nimrod-code/aporia), a build farm (https://github.com/nimrod-code/nimbuild) and a web framework (https://github.com/dom96/jester). The Nimrod forum (http://forum.nimrod-code.org) is also written in Nimrod.
Post reply on HN