Live data from Hacker News

Pyret – A language exploring scripting and functional programming

pyret.org

191–200 of 272 posts

Re: Pyret – A language exploring scripting and functional programming

#191

Earlier quoted context omitted.

Compare CL to Scheme. One was designed for Real Work, the other for PL research and teaching. The difference is stark.

And yet Racket grew out of Scheme and is now every much a Real Work language as CL, while avoiding CL's warts. So your point is…?

Racket is still immature, still has a focus on education, and has more than enough warts of its own.

For that matter, so does Scheme: It just has less of them. Which has its problems.

Oh, and Racket is in no way as good for Real Work as CL. It doesn't have the libraries, and it sure as heck doesn't have perf.

Re: Pyret – A language exploring scripting and functional programming

#192
post #187

For what it's worth, I'm a student at the University at which J Politz teaches. I haven't taken the programming languages course which is taught in Pyret, but it's worth noting that it's an upper level course here and everyone I know who's taken it is a fairly experienced programmer (relative to university CS standards, of course). So, if the fear is that Pyret is an unrealistic/overly complex/non transferable langua…

Hey fellow Swattie! [Actually, I'm at UC San Diego as of this fall, so I'm a former fellow Swattie, I suppose :-) ]

The programming languages course in question (https://www.cs.swarthmore.edu/~jpolitz/cs91/s15/) indeed used Pyret, and that course is a heavy functional programming implementation course (writing interpreters, type inference, GC, etc).

That's using Pyret for more complex programming, and is the upper end of where we use it pedagogically right now. Ditto for CS019 (the advanced introduction to data structures), and CS173 (PL) at Brown. In all of those cases, students _are_ expected to have some prior programming experience, so they get a faster introduction to Pyret.

In the other direction, Pyret is in active use at the middle and high school level in math, cs, and physics classes, and this is where much of our active design work is tailored (tables, reactors, etc have some explicit curricular goals they target). They have scaffolding and workbooks written for their grade level, use features suitable for the context they are in, and so on.

The use in CS91 in particular is

(1) appropriate in the first place, since many functional languages could work in that setting, (2) eating my own dogfood, and (3) an excellent opportunity to discuss design decisions of a language that students are learning in a PL course, while it is still having design decisions made about it!

Re: Pyret – A language exploring scripting and functional programming

#193
post #114

Earlier quoted context omitted.

> Languages such as C, Java, Python, and Rust are usually designed by experienced programmers in industry, for experienced programmers in industry. Pyret, on the other hand, is designed by computer science educators, for computer science education. Honestly, looking at the examples on the Pyret main page makes me think that this isn't a good approach at all. I have been in software engineering for many years now and…

What characteristics makes a programming language a " real " programming language?

This is kinda like learning CS theory - kinda useful to keep in mind for other things, but never actually used. ie -> set theory, Finite automata, Turing machines etc...

Re: Pyret – A language exploring scripting and functional programming

#194
post #114

Earlier quoted context omitted.

> Languages such as C, Java, Python, and Rust are usually designed by experienced programmers in industry, for experienced programmers in industry. Pyret, on the other hand, is designed by computer science educators, for computer science education. Honestly, looking at the examples on the Pyret main page makes me think that this isn't a good approach at all. I have been in software engineering for many years now and…

I think that's taking it a bit far. I especially don't see how being explicit about the problem you're solving (teaching computer science to newcomers in a collegiate setting) and focusing the effort towards that problem and iterating on the methods used to teach it (building better tools and iterating without importing unnecessary baggage) is "actively harmful." Simply looking at text in a different language is not…

> I think that's taking it a bit far. I especially don't see how being explicit about the problem you're solving (teaching computer science to newcomers in a collegiate setting) and focusing the effort towards that problem and iterating on the methods used to teach it (building better tools and iterating without importing unnecessary baggage) is "actively harmful."

It's pretty clear that I was specifically referring to the language at hand and not to general idea/concept.

> ... needs this ... using it ...

Re: Pyret – A language exploring scripting and functional programming

#195
post #52

I've never understood the idea of a 'teaching' programming language. (Modulo examples like Logo and Scratch, which offer much more than a language as part of a wider teaching/computing system.) You spend all this time ramping up on a language, toolchain, library, etc, that you will eventually be unable to leverage beyond a certain point since it is not one used by everyday programmers. The delta in "quality learning"…

Languages such as C, Java, Python, and Rust are usually designed by experienced programmers in industry, for experienced programmers in industry. Pyret, on the other hand, is designed by computer science educators, for computer science education. This does not preclude Pyret from being a useful language for general-purpose programming; it just means that language design decisions are driven foremost by pedagogy. For…

"For example, Pyret trades performance for mathematical familiarity by using exact representations of rational numbers as its primary number type."

(Disclaimer: I haven't used Pyret) But.. maybe the language allows the developer work out problems differently. With that in mind, perhaps asserting that the language was built for education, [so as to imply that it'll make you a better programmers in general, even in 'bloated or expert' languages], doesn't necessarily shed light on its actual benefits -- but I'll check it out later on to find out for certain.

Re: Pyret – A language exploring scripting and functional programming

#196
post #102

I strongly believe that people who are learning to program should learn in a language that can actually be used to make things. This may run counter to the 'work smarter, not harder' ethos I see here but I feel that programming competency in practice is much more a function of literal hours writing code than any other factor.* *with the caveat that competency tends to follow a sub-linear growth curve and people vary…

People who learn to program have to get used to the idea that programming languages are many, and they have to attain certain competence in several of them. A typical frontend dev uses Javascript, CSS, HTML, likely some occasional bash. A backend developer probably faces the preferred backend language (Java / Python / Ruby / PHP / whatever), SQL, and has to have at least a nebulous understanding of HTML, CSS, and JS.…

> There's no way you learn the One Practical Language That Matters and can be limited to it.

Most mainstream languages have very similar semantics overall, differing wildly from FP-like approaches. So learning a mainstream-ish (imperative-ish, OO-ish) language will enable mastering other mainstream languages with greater ease.

If my first language is Lisp-1944, I'll likely have a hard time learning C or Java. If, on the other hand, my first language was C, I'll likely have much more and quicker success with Java, Python, C#...

Re: Pyret – A language exploring scripting and functional programming

#197

Earlier quoted context omitted.

What characteristics makes a programming language a " real " programming language?

The most important distinction would be that you don't have to make a transition from education contexts to production contexts. I mean, why isn't it possible to design a language that is both quite fit for education & production? Is Python vs. Pyret really that big a difference in education outcomes? This is important for professors & TA's, educators, or enthusiast parents who wish to teach their children. All have…

Yes, it is a big difference, depending on what you're trying to teach. If you want to teach a conventional CS curriculum recognizable from the 80s, Python is great (though some people really prefer teaching with static types, which Python does not have and which are absurdly hard to add now). Here are several other differences: https://news.ycombinator.com/item?id=13189513

Re: Pyret – A language exploring scripting and functional programming

#198

Earlier quoted context omitted.

And yet Racket grew out of Scheme and is now every much a Real Work language as CL, while avoiding CL's warts. So your point is…?

Racket is still immature, still has a focus on education, and has more than enough warts of its own. For that matter, so does Scheme: It just has less of them. Which has its problems. Oh, and Racket is in no way as good for Real Work as CL. It doesn't have the libraries, and it sure as heck doesn't have perf.

Says you, and many disagree, including Racket's commercial users. But of course it's pointless arguing with a CL fanatic (I learned that two decades ago on c.l.s, and looks like nothing has changed), so please do go ahead and have the last word.

Re: Pyret – A language exploring scripting and functional programming

#199
post #36

Earlier quoted context omitted.

In the same world is easier to understand for advanced developers. You know n is a number and the result is a number. You don't need to "type check in your head". Remember Pascal? Being explicit is good for education and for regular sanity. P.D: I like python very much, but all the time I'm wondering "ok, what is the meaning of this code, let's find elsewhere so I can remember what is supposed this return" This also…

Use IDE which runs type inference like the compiler when that's a problem. Can't do it in Python though.

Programmers use a variety of editors these days. They often don't want to be locked down to one single IDE. So "let the IDE do it" is not a universally satisfying answer either.

Re: Pyret – A language exploring scripting and functional programming

#200

Every time I see a project pop up touted as being simple and a good "teaching language", it has some weirdness or pet features thrown in that turns enough people off to keep adoption low. If you want a good teaching language which will receive substantial adoption, do this: * syntax-wise, use curlies and semicolons like C, Java, Perl, JS, etc. * use many of the good function names that Perl uses. * have all variables…

Some of these are good ideas (e.g., nice lexical scoping). Pyret has most of these. Pyret also lacks any complicated, advanced, amazing features, for probably the very same reason you made that suggestion.

Some of these lead to endless bikeshedding (e.g., curly syntax) without much of a way to resolve it. Pyret has one position on these, others may have others.

And some of these are just plain invalid in some contexts (e.g., implement it in C). Our target audience is browser-bound: many of the schools we work with cannot install software on their desktop (so no compiler, IDE, etc.). Implementing in C is therefore a non-starter.

Pyret is therefore built atop JavaScript, targeting JavaScript. However, Pyret is built entirely in Pyret, so if we were to build a different back-end codegen, it would be straightforward to port it.

Post reply on HN