Live data from Hacker News

Pyret – A language exploring scripting and functional programming

pyret.org

1–10 of 272 posts

Re: Pyret – A language exploring scripting and functional programming

#2
So, as someone without too much experience in language development, the concept of having unit tests being an extension of the functions themselves seems very interesting. Clearly this doesn't work for all scenarios—multiple functions interacting, any sort of GUI interaction—but that's a very intriguing concept.

Re: Pyret – A language exploring scripting and functional programming

#3
> "while exploring the confluence of scripting and functional programming"

Scripting and functional go amazing together, as long as it's (mostly) dynamic typing. In general, types really just get in the way when scripting or prototyping or trying to do anything fast, especially when you don't know the types of data you're going to be working with ahead of time, e.g. when it comes from a file or from an external API, etc.

But what is BinTree in the following example on the website? Is it a type? Is it a function, or constructor, or what? I'm confused.

    data BinTree:
      | leaf
      | node(value, left, right)
    end

Re: Pyret – A language exploring scripting and functional programming

#4
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 definitely a step back in terms of readability.

In what world is:

  fun square(n :: Number) -> Number:
    n * n
  end
...easier for a beginner to understand than:

  def square(n):
    return n * n
I get that the intention of this language seems to be to help beginners avoid some of the more common pitfalls that they may run into (ex. unexpected parameters and return values), but it seems like they do it at the expense of the total beginner's ability to understand and keep track of lots of new concepts when they're just starting out.

Re: Pyret – A language exploring scripting and functional programming

#5
Honestly imo Python is the best language to start with for learning.

It has all the basic constructs of both functional and object oriented programming in plain english without a bunch of syntax to worry about. I personally think it's the most readable language. it's also quite intuitive imo. Lastly, there's a fantastic community and instant help is available for all skill levels but especially beginners on #python on freenode irc

Pyret... isnt very readable, doesnt seem very intuitive, has somewhat odd syntax, and generally seems like a terrible choice for learning. Doubt it has the resources quality python has (community, docs, tutorials)

i dont get it.

Re: Pyret – A language exploring scripting and functional programming

#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.

Re: Pyret – A language exploring scripting and functional programming

#7
post #2

So, as someone without too much experience in language development, the concept of having unit tests being an extension of the functions themselves seems very interesting. Clearly this doesn't work for all scenarios—multiple functions interacting, any sort of GUI interaction—but that's a very intriguing concept.

Agreed. It probably helps enforce pure functions, which are one of the big pros touted about functional programming. Ideally most functions should be pure and isolatable from the rest of the program.

Re: Pyret – A language exploring scripting and functional programming

#8
post #3

> "while exploring the confluence of scripting and functional programming" Scripting and functional go amazing together, as long as it's (mostly) dynamic typing. In general, types really just get in the way when scripting or prototyping or trying to do anything fast, especially when you don't know the types of data you're going to be working with ahead of time, e.g. when it comes from a file or from an external API,…

Pretty sure its a union type.

Re: Pyret – A language exploring scripting and functional programming

#9
post #2

So, as someone without too much experience in language development, the concept of having unit tests being an extension of the functions themselves seems very interesting. Clearly this doesn't work for all scenarios—multiple functions interacting, any sort of GUI interaction—but that's a very intriguing concept.

Is there something that prevents you from making functions that only check how other functions interact?

Re: Pyret – A language exploring scripting and functional programming

#10
Yarr! Pyret always seemed like a great idea to me. It's still quite-scheme-y, and so can introduce functional programming ideas easily, without the hangups people normally have about syntax. It also has minimal weird-language-cruft that is hard to explain to beginners, that you'd normally have to be like "ok ignore the int argc, char argv for now". And it runs in the browser. Awesome. Can't wait to get a chance to dig in further.

Also, try code samples in here: https://code.pyret.org/editor

Also, scroll down to see the comparison vs other languages: http://www.pyret.org/#examples

Post reply on HN