Live data from Hacker News

Pyret – A language exploring scripting and functional programming

pyret.org

201–210 of 272 posts

Re: Pyret – A language exploring scripting and functional programming

#201
post #18

When I was student, my favorite language syntax was Caml, the ancestor of OCaml. I am surprise there was comparison with many languages but not OCaml.

Pyret is similar to the ML family in many ways.

Some would say Pyret's syntax is an improvement over that of OCaml. (Others might not.)

A critical difference is that Pyret does not force static typing. The type-checker is optional, so beginning students, in particular, do not need to deal with the overhead of type errors and the vagaries of type inference. But Pyret's design, and pedagogy, aim to push students towards an ML style of programming with ML-like types (e.g., the language does not have untagged unions).

In fact, type inference in Pyret is done not from the code but from the tests the programmer has written. This is a very different philosophy of not just inference but program development.

Re: Pyret – A language exploring scripting and functional programming

#202

Earlier quoted context omitted.

Hi, I'm actually the person who wrote the static type checker. Essentially we get around the difficulties of mixing objects and ADTs by having very limited support for subtyping. This way we can still carry out unification-based inference. The subtyping bounds are not propagated during unification so we don't need to worry about calculating closures. This does mean that type inference is incomplete with respect to su…

Hi, thanks. Primarily I wondered about actual mixing of ADTs and objects, which is limited even in OCaml, see e.g.: http://caml.inria.fr/pub/ml-archives/caml-list/2003/06/bed28... But does Pyret always translate an ADT to a class hierarchy behind the scenes? This example sure looks like it does: data Animal: | elephant(name, weight) | tiger(name, stripes) | horse(name, races-won) ... end fun animal-name(a :: Animal):…

To add to @mkolosick's reply: Pyret doesn't have classes and hence class "hierarchies".

Re: Pyret – A language exploring scripting and functional programming

#203

What's the point? One would hope they start with a description of why this is better for education than something like Python. I just gave it a quick glance, and it looks like many other programming languages - a bunch of odd text gibberish. I don't think the problem dividing people into "gets it" and "doesn't get it" has anything to do with nuances in syntax or semantics.

If you want to understand better the comparison to Python, see https://news.ycombinator.com/edit?id=13189513

Re: Pyret – A language exploring scripting and functional programming

#204
post #88

Earlier quoted context omitted.

Despite what the down voters think, I actually found this comment useful because I had the exact opposite reaction. I took a quick look at the examples, saw familiar syntax and features and quickly concluded it looks like a nice toy, but I'd probably never use it because there are way too many unknowns (Performance, runtime, buggy, etc. etc.). I was actually a little flabbergasted when you said it looked like "odd te…

>> Unless I'm familiar with union types, what part of that code tells me this is a parameterized enum? Why should I assume we're even talking about data types? I have fond memories of learning to program as a kid. Concepts like trees, nodes, and data types have no place in an introductory programming for kids. The initial idea to teach is the notion of getting the machine to follow a set of instructions. IMHO even fu…

I too learned BASIC first. It was fine for what it was. And computing has come a long, long way from there, and our pedagogy has evolved substantially. In fact, kids have no trouble with concepts like lists and trees — I see more trouble with it from people who learned programming poorly before than people who didn't learn to program before at all.

Also, nobody said Pyret is for kids (defined as pre-teen). It's not.

Re: Pyret – A language exploring scripting and functional programming

#205
post #96

Earlier quoted context omitted.

Do you have any measurable (preferably peer-reviewed) evidence that suggests imperative programming is inherently easier? That sounds like a challenging claim to make.

> a challenging claim to make ...or more like the obvious intuition and wisdom of 99% of working software developers. The intuition is not backed up by any peer-reviewed evidence but by the real world fact that most production code ends up written in C++, Java, C#, JavaScript, PHP, Python,Ruby etc. and not Haskell, OCaml, F#, Clojure etc. Since they made the first stone tools and cave drawings, humans have always def…

> obvious intuition

I don't mean to throw it out, but I try to be skeptical of obvious intuition. I just feel like people were saying "the Earth is obviously flat" (and plenty of other examples). Which from a practical point of view for a lot of people, the Earth was effectively flat. I'm certainly not saying "FP-Master-Race!" But I try to be wary of the fact that history is important but imperfect. Imperative programming is terrifically important, but that does not necessarily mean it is inherently more humane.

Re: Pyret – A language exploring scripting and functional programming

#206

The annoying banner was distracting from the actual content unfortunatenly. From what I did see I don't see a reason to start using it in education to be honest. I don't see the problem with just teaching Java or Python. Sure it might be a bit harder, but it's what you'll end up using in the real world

https://news.ycombinator.com/edit?id=13189513

Re: Pyret – A language exploring scripting and functional programming

#207
post #32
post #6

"We need better languages for introductory computing." and "One of the enduring lessons from the Racket project is that no full-blown, general-purpose programming language is particularly appropriate for introductory education." Well not really, we need better teachers and methods for teaching programming and computing. A good language on its own is not gonna lift the interest.

> Well not really, we need better teachers and methods for teaching programming and computing. I think most of the Pyret developers would agree wholeheartedly! To this end, the Pyret development team works closely (and in some cases, overlaps) with Bootstrap [1], a nation-wide program to teach programming to middle school students. The feedback we get from these teachers (and the process of teaching teachers) directl…

Is there a good quality MOOC on Pyret? I am not in high school but am not a programmer either. I started using DrRacket MOOC fairly recently on Edx and had no idea about Pyret until today. My interest in finding good quality teaching, led me to Racket, all the way from the hype of Python/Ruby, and anyone else in between. I am trying to follow Racket but now I am confused between Racket and Pyret.

Re: Pyret – A language exploring scripting and functional programming

#208

As someone who teaches coding to beginners for a living (I founded One Month and I teach Python to business students at Columbia University), this language looks really intimidating to beginners. Maybe Pyret isn't for beginners, and it's intended to teach people who already have some basic knowledge more advanced concepts like functional programming. That's fine. But to a total beginner, the syntax of Pyret is defini…

The first version looks more like something you'd see in a math book, which is where a non-programmer's notion of what a "function" is would likely come from (assuming they have a notion at all).

Re: Pyret – A language exploring scripting and functional programming

#209
post #32

Earlier quoted context omitted.

> Well not really, we need better teachers and methods for teaching programming and computing. I think most of the Pyret developers would agree wholeheartedly! To this end, the Pyret development team works closely (and in some cases, overlaps) with Bootstrap [1], a nation-wide program to teach programming to middle school students. The feedback we get from these teachers (and the process of teaching teachers) directl…

Is there a good quality MOOC on Pyret? I am not in high school but am not a programmer either. I started using DrRacket MOOC fairly recently on Edx and had no idea about Pyret until today. My interest in finding good quality teaching, led me to Racket, all the way from the hype of Python/Ruby, and anyone else in between. I am trying to follow Racket but now I am confused between Racket and Pyret.

There is no MOOC I know of that uses Pyret (yet).

Racket is great! If you're already deep into Racket, I wouldn't say stop to try Pyret unless you particularly have the goal of learning more languages, or there's something about Pyret that really gets you interested.

We taught a programming languages course that uses Racket back in 2012, but all the material is still online:

https://cs.brown.edu/courses/cs173/2012/

So if you're looking for online content that we recommend, that could be an interesting next step that makes use of the momentum you have in following Racket.

The Pyret book PAPL is free online, and it's possible to dive in and follow that if you're curious about learning Pyret, though it doesn't have the infrastructure of assignments with autograders, etc, that a MOOC would have:

http://papl.cs.brown.edu/2015/

Post reply on HN