Better HN
topnewbestaskshowjobs
Log inSign up

Scriptor

1,852 karma · joined Nov 10, 2008 (18y ago) · 533 submissions

Github: http://github.com/Scriptor
Submissions

comment 15y ago · link · parent

The person who told me the above was my own mom, who is from South Asia :) In that region at least medicine and engineering are very common for girls to go into, not so much other fields requiring a college degree (I think). Again, just anecdotes.

comment 15y ago · link · parent

One possible reason for this is that in those countries science/engineering is often one of the few routes an educated women has available. I've only heard this anecdotally and haven't been able to research it, but it could be one factor.

213.

Clooj, a lightweight IDE for Clojure(github.com ↗)

2 points · by Scriptor · 15y ago · discuss

comment 15y ago · link · parent

While a state itself never changes, Clojure can be in different states!

comment 15y ago · link · parent

It's interesting to consider how the ancestors of modern humans who first had 46 chromosomes became dominant. It could have been due to simple genetic drift, maybe the family with the translocation had a high number of offspring by chance for generation after generation, until it became a significant portion of the population of the early hominids.

More likely, (in my opinion), is that the translocated chromosome itself contained some beneficial alleles (gene versions) that gave its carriers an edge. This has nothing to do with the translocation itself, it just so happens that that particular chromosome could have a version of a gene (or versions of several genes) that increased the carrier's fitness in the environment. Some of theories regarding early hominid evolution cite a movement away from heavily forrested regions into more open grasslands. Maybe this early translocated chromosome contained alleles that were beneficial in the savannas.

At this point you'd have a number of individuals with one copy of the translocated chromosome and 47 total chromosomes (meaning the other homologous (http://en.wikipedia.org/wiki/Homologous_chromosome) chromosomes are not joined together, "normal") and a number of people who still had the original 48 chromosomes. As the article mentions, only 1/3 of the pregnancies of a 48-chromosome individual with a translocation individual would survive. However, if there was inbreeding present individuals with the translocated chromosome could be mated with each other. Here we have an even less likely chance of a successful pregnancy (8/36 or only 25%) but on the other hand we now have the possibility of individuals with just the translocated chromosome. Instead of a joined chromosome and 2 unjoined chromosomes, these individuals have 2 joined chromosomes and a total of 46 chromosomes.

Now remember that I postulated that the joined (translocated) chromosome could have carried beneficial alleles as opposed to other, unjoined versions. Some of those alleles may be recessive, meaning they'd be eclipsed by other alleles. For an individual with two copies of the translocated chromosome they would only have those recessive alleles, so they wouldn't be as likely to be eclipsed. Again, these recessive alleles may have brought about beneficial traits that weren't expressed in individuals who only had one joined chromosome. Thus, individuals with 46 chromosomes could have had an even higher chance of survival and finding other 46-chromosome individuals, thus continuing this trend.

Anyway, I admit that much of the above is really just guesswork so take it with a grain of salt. I'm primarily exploring the possibilities that could have resulted in the original 48->46 chromosome shift. It was probably a mix of genetic drift, having beneficial alleles, and the founder effect (http://en.wikipedia.org/wiki/Founder_effect). Hope you enjoyed it!

comment 15y ago · link · parent

I'd be interested in the quantum mechanics explanation of how the daemon reduces entropy. When I discussed the thought experiment with some friends we simply concluded that the very act of sorting the molecules is introducing outside energy into the system allowing local entropy to be reduced, just like any other machine. The total entropy of the universe would stay the same and the laws of thermodynamics are still intact.

comment 15y ago · link · parent

My guess would be that it was built up by several of the team members and they just pasted the links from where they found them, which was probably Twitter.

comment 15y ago · link · parent

It looks like the book for that is already out: http://oreilly.com/catalog/9780596804381

comment 15y ago · link · parent

One of the symptoms of the hodge podge is things that should be in the interpreter when they're actually in the parser. For example:

    isset($foo, 2)
Returns a parse error, even though isset looks like a function call and you're just passing it an extra parameter.

comment 15y ago · link · parent

I actually had the opposite experience. I have both the electronic version and the paper version of a very large book. While it is fun in a nostalgic way to read it from the book, it's really awkward to read it anywhere other than a table with something to tilt it. The kindle I can take anywhere and be quite comfortable with it. For example, reading it while lying sideways in bed is a piece of cake.

comment 15y ago · link · parent

I really need to get around to reading this. The original LOTR did have a rather "western" bent to it. Looking at things in another way would be pretty fun.

Also related: http://www.mcsweeneys.net/2003/04/22fellowship.html, if Noam Chomsky and Howard Zinn watched The Fellowship of the Ring.

222.

A Whole Lotta Automata (with Clojure)(sexp.posterous.com ↗)

3 points · by Scriptor · 15y ago · discuss

comment 15y ago · link · parent

That's a really good question. The main case I can see is if someone is already familiar with PHP and its deployment and doesn't want to learn another language/platform. It might also be useable for basic scripting tasks (the compiler has an --executable flag that adds a PHP hashbang to the top of a script).

Other than that Pharen is still pretty new and nowhere near the same level as mature lisps. Making debugging and interop with 3rd party libraries easier are the main long-term goals, so maybe after that it'll be at least a little viable.

comment 15y ago · link · parent

The current dictionary syntax is actually typical for lisps, particularly this is exactly what Clojure does. It's just a series of elements except in this case it's designed to look at every two elements as a pair.

What do you mean by it's inconsistent? Commas are the same both in dictionaries and anywhere else, they're completely optional.

comment 15y ago · link · parent

>Is there a way to expand macros only and not do the compile-to-php step?

So that it would just generate the Pharen code resulting from the expansion? Unfortunately, not yet. As soon as a macro is done executing it returns the node tree itself, which is then compiled. There might be a way to hack macro-expand in though.

Let me know how trying to work it into your project goes! I'll be glad to help with any problems that come up.

comment 15y ago · link · parent

I guess I wasn't exactly sure just how widespread PHP 5.3 was and wanted to play it safe. Also, even if new servers nowadays come with 5.3, a lot of existing code is still running on 5.2.

comment 15y ago · link · parent

Possibly, it might have a use in some web framework ideas I have (such as designate a series of actions to perform on something like input data).

comment 15y ago · link · parent

I'd say it's closer to Clojure than others lisps, but there are still some differences. For example, no keywords (:foo, :bar, etc.) and lists are not functions of their members. This can get a little confusing with Pharen's array access syntax:

    (:some-list 1)
Here, some-list is just a variable while the : prefix tells Pharen that you are trying to index into it.

comment 15y ago · link · parent

Nope, it should work for PHP 5.2 as well. Closures are implemented using a static member on a class that handles all the lexically scoped variables, not PHP 5.3's native closures.

comment 15y ago · link · parent

I haven't done any real benchmarks, but theoretically Pharen would have at least the same order of magnitude performance as regular PHP. The main things slowing it down is the memory overhead needed for using lexical scope.

comment 15y ago · link · parent

Thanks Mahmud :)

Efficient sequences are what I'm working on right now, particularly trying to make persistent versions of the major data structures in PHP.

Tail calls are another thing, though with PHP 5.3's gotos they could be done (who'd have thought that feature would ever be useful?) Could you elaborate on how I could improve efficiency for macros?

comment 15y ago · link · parent

The big one is that Lisphp is an interpreter while Pharen is a compiler. Lisphp takes source code and just runs it, which means that it's lisp code running on Lisphp, which in turn is running on the PHP interpreter.

Pharen generates regular PHP source files that you can then throw wherever PHP works.

comment 15y ago · link · parent

Both really, since interop with PHP is pretty easy so you can use those native features in a lispy way.

comment 15y ago · link · parent

Originally, for fun!

It gives you a chance to use Lisp's syntax and mentality if you're stuck with PHP on the backend. Moreover, you have features like macros and lexical scope, which can be useful.

comment 15y ago · link · parent

Hi everyone, I'm the creator of Pharen. Feel free to ask me questions or remind me why this is a terrible idea. :)

Yes there are a lot of issues with cross-language compilers. That said, Coffeescript: http://coffeescript.org, which compiles its own language to Javascript has had a lot of success and is being used in production. So it's at least possible to use languages like this.

The extra layer of abstraction is a big hurdle. When debugging you have to find the source of the problem in the PHP, though ideally after that you can just find the matching Pharen code and go from there. One of the things on my todo list is to have at least a rough line-to-line tracker built, so that it could at least tell you the general location a problem happened, if not the exact line.

Translating docs and example code for existing libraries into Pharen is a bigger issue, I think. Mainly because Pharen emphasizes a functional style of coding while most PHP code assumes you are doing things imperatively. This is something Clojure has to deal with in terms of Java interop so again it shouldn't be too hard to get around.

In terms of efficiency there is tail recursion optimization (converts a recursive function to having a while loop at the end) and a persistent sequence library in the works that would make functional looping through a list about as fast as imperative iteration. More aggressive optimizations might come in the future.

If you're interested, feel free to contribute: http://scriptor.github.com/pharen/contribute.html. If you use IRC you can come hang out (or berate me personally) on #pharen on Freenode. Any suggestions or ideas are welcome.

comment 15y ago · link · parent

He was just having fun with by combining this with another site which does a similar thing.

237.

Iteration in Scala - effectful yet functional(debasishg.blogspot.com ↗)

2 points · by Scriptor · 15y ago · discuss

comment 15y ago · link · parent

Not sure, but I think it's a journalistic convention. Since the person was not generally well known, the quotes indicate that it's something others who do know him say. They're not being sarcastic.

comment 15y ago · link · parent

Hey, creator of Pharen here. I've been procrastinating on another release for a while but still developing it. If anyone wants to check it out there is a better site over at http://scriptor.github.com/pharen.

comment 15y ago · link · parent

I'm not sure about the specifics of what iwwr is thinking, but basically I think he means that humans have the ability to create and pass on knowledge (state) from one generation to the next. Because each generation only has to build off of the knowledge of previous ones there is no set limit to how much humans as a whole can know.

Technically, this ability isn't unique to humans alone. Other species, such as dolphins and chimpanzees, are also able to create and pass on knowledge. For example, certain dolphins around Florida have developed a strategy of catching fish by first encircling areas of water by kicked up sand: http://www.youtube.com/watch?v=ArsoMcVi5MM&feature=playe... This is purely a learned behavior and has to be taught to offspring.

1
789
18