Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jpolitz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
91.
▲
by
jpolitz
13y ago
Thanks for the feedback. Re: scope, you're right that using "def" the way I did isn't very idiomatic Ruby, but I always run afoul of it because it looks so similar to what I'd write in another language. I took that
92.
▲
by
jpolitz
13y ago
I've done a fair amount of programming in Ruby (two reasonably large Rails applications, spanning about two years of development time). When switching to Ruby from just about anything else that I program in from JavaScript to Python t
93.
▲
by
jpolitz
13y ago
There's another response to this that I didn't mention. Shriram is writing a textbook that includes all the material for our advanced intro course and our programming languages course. There's a lot of good examples here:
94.
▲
by
jpolitz
13y ago
> Do the type annotations result in performance/compiler optimization, as in Julia? We've been designing the static system with exactly this in mind. The current implementation doesn't do anything fancy yet, but that'
95.
▲
by
jpolitz
13y ago
That's a useful comparison, thanks. While we were certainly inspired by Pythonic syntax, we have ended up somewhere slightly different. The note about local variables is particularly important; we actively don't want Python&#
96.
▲
by
jpolitz
13y ago
You can actually use ";" as an alias for "end" in Pyret, so you could write: data BinTree: | leaf | node(value, left, right); We use "end" or ";" in order to have unambiguous delimiters for t
97.
▲
by
jpolitz
13y ago
Syntax is tricky and contentious, and our team members do love our Schemes. Members of the Pyret team have actually done some research on the issue of parenthetical expressions in introductory programming, and seen that parens aren't
98.
▲
by
jpolitz
13y ago
Thanks for your comments! I have two responses: 1. You're right that exposing too much, too soon is a recipe for disaster. People can only fit so many new concepts in their head at once, and blasting them with refinement types from d
99.
▲
by
jpolitz
13y ago
Thanks for the questions! As to why we're advertising it as a teaching language: Our group has a design sense of how to do this, and Pyret's success in the classroom is what we're able to study, measure, and focus on improvi
100.
▲
by
jpolitz
13y ago
This is absolutely awesome. I have a few thoughts right off the bat. 1. It would be nice to put a Gatherer link in every response, just for browsing purposes. 2. Split cards are weirdly reported, as if they are two separate cards. In Gathe
101.
▲
by
jpolitz
14y ago
Here's one related study, "examining the extent to which individuals will tolerate delays when told that such delays are for security purposes..." http://cs.brown.edu/~sk/Publications/Papers/Published/emcahk... Please Continue to Hold: An
102.
▲
by
jpolitz
14y ago
Indeed --- Python goes to great lengths to work this way, automatically binding the self argument on method extraction. o.f() Can be decomposed in Python: func = o.f func() JavaScript fails this test, and it's a shame.
103.
▲
by
jpolitz
14y ago
Thanks, not sure what I was smoking there. I can't seem to go back and edit, though...
104.
▲
by
jpolitz
14y ago
My comment was wrong, I was mis-remembering a bug that I'd seen before. You can get everything correct with the prototypes, but you cannot perfectly emulate it. The only thing you can't do with JS emulation of .bind() is the ability to cre
105.
▲
by
jpolitz
14y ago
Yeah, those were mentioned in the post as exception 2, but maybe I should make a note.
106.
▲
by
jpolitz
14y ago
I'm confused... doesn't that just reduce the question to "what is the current binding of self"?
107.
▲
by
jpolitz
14y ago
That's a reasonable way to think about bind(). On a pedantic note, due to complications with the new() operator, you can't actually implement .bind() in JS using only .call() and .apply() and get the prototype of the resulting objects right
108.
▲
by
jpolitz
14y ago
The this keyword is confusing, it's good to see posts clarifying it. However, while the rule in the post will be right in many cases, this list is incomplete, even for some common usages of this, and might lull folks into a false sense of
109.
▲
by
jpolitz
14y ago
Like this? function fibs(size) { return f(); function f() { ... implementation here ... } }
110.
▲
by
jpolitz
14y ago
Cool! Sucks that it has to be so stringly typed, but I can't see another alternative. One concern: "Each pattern will be tried in order until a match is found." As far as I know, ECMAScript doesn't specify any enumerations on objects that
111.
▲
by
jpolitz
14y ago
It looks like the λJS has an issue parsing some of the escape sequences in underscore.js; it's a bug in WebBits parser that version uses. Another implementation of the core semantics + desugaring approach, dubbed S5 ( https://github.com/bro