Live data from Hacker News

Pyret – A language exploring scripting and functional programming

pyret.org

51–60 of 272 posts

Re: Pyret – A language exploring scripting and functional programming

#51
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 significantly with respect to their growth rate so this statement is more accurate when comparing individuals who are early in their growth curve aka beginners.

Re: Pyret – A language exploring scripting and functional programming

#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" between a teaching language and a non-teaching language would have to be astronomically high, imho, to offset the difference in capability and the opportunity cost of learning an applicable skill to a wider problem set. Something that is just a slightly better Python or a slightly better Clojure for the purpose of illustrating computer science concepts seems like something that you'd be doing a disservice to students to teach, vs the "real thing" which they could carry for the rest of their lives into future projects ad infinitum.

Re: Pyret – A language exploring scripting and functional programming

#53
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?

Scoping rules probably get in the way in some cases.

Re: Pyret – A language exploring scripting and functional programming

#54

Unexplained important things: * concurrency, is there any nice built in syntax like Python async? Any kind of threading? Multiprocessing support? * error handling, how is it done? Where are exceptions? * standard and file io, string operations, serialisation? * no builtin higher math types (matrix etc.), is math done on decimal floating point numbers? * foreign functions, interfacing with other languages, embedding?

Also:

* metaprogramming - templates, macros, generic programming?

Re: Pyret – A language exploring scripting and functional programming

#55
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?

[deleted]

Re: Pyret – A language exploring scripting and functional programming

#56
For me, this looks MUCH more like Haskell than Python and I think that this is symptomatic of an erroneous claim that some functional programming proponents seem to constantly make: That declarative, "mathy","deconstructive" programming is somehow easier to learn than imperative, "algorithmic", step-by-step constructive programming.

In reality, most people in the world struggle with abstract mathematics and find it much more intuitive to think about a program as a series of steps and in terms of control flow. Programming beginners want to draw nice pictures on their computer, not struggle with understanding and implementing some recursive function.

This is of course not to say that recursion is not an important concept or that functional languages have no merits. They are however complicated abstractions over simple concretions that are much easier to understand for a beginner.

Re: Pyret – A language exploring scripting and functional programming

#57
I really like the idea of tests right beside the code. I don't like how it's code though. Muddles what the actual implementation is a bit. Maybe with more usage the where statements start to blur and you don't notice them as much.

I like Elixir's approach better where your test cases live as documentation examples in comment form, right above the function declaration. It's fantastic and free. Your mix test command runs tests, in addition to any examples you have as tests.

http://elixir-lang.org/getting-started/mix-otp/docs-tests-an...

You put your tests as comments below an ## Example header. Oh and these examples go into your auto generated documentation as well. Ridiculously effective and free. You feel bad not using them.

Re: Pyret – A language exploring scripting and functional programming

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

It's pretty awesome. This is the feature that stands out to me for Pyret. Also see how Elixir does it: http://elixir-lang.org/getting-started/mix-otp/docs-tests-an...

Re: Pyret – A language exploring scripting and functional programming

#59
post #42

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…

Pyret is inspired from Racket, which starts at step 1 with functional programming. It's not about readability or getting people to learn as fast as possible to write basic code, but to try and teach core program design principles easily and build a solid base within a single semester. The syntax is not as clean as Python, but it offers much more clarity in terms of testing, signatures, and offers a very interesting m…

> arguably, is that it doesn't look like much else out there in common use, since it's a Scheme.

That is a beauty of Lisp especially Racket. Every thought is explicitly inside a bracket.

I am a self-taught programmer started with Assembly Z80, Pascal etc.. I mostly work with R now a days and I was struggling with R to get to the next level. I picked up a book and learned Racket and the convergence of R and Racket was totally unexpected. I missed all the Scheme influence in R and most R programmer in the past didn't use that part of the language. So as a learner them brackets are golden especially for learning concepts.

Re: Pyret – A language exploring scripting and functional programming

#60

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…

In what world is:

  def square(n):
    return n * n
... easier for a beginner to understand than:

  square n = n * n
Post reply on HN