Earlier quoted context omitted.
Yes, Pyret is totally indentation-insensitive.
FOR NOW. We have a plan for making the indentation checked but it's not been our top priority, but it is on our stack. Languages take a while to cook. Welcome to the kitchen. (-:
Pyret – A language exploring scripting and functional programming
221–230 of 272 posts
Re: Pyret – A language exploring scripting and functional programming
#222Earlier quoted context omitted.
I'd say that white space requirements around operators even seems implicitly consistent with the Pythonic idiom of semantic white space and the Pythonic dictum of only one way to do things.
Python has many ways to do just about everything (e.g., list comprehensions are completely redundant). It's a nice marketing slogan, though.
Re: Pyret – A language exploring scripting and functional programming
#223Earlier quoted context omitted.
I think you are intentionally simplifying my statements, and the intents of educators, in an intentionally disingenuous way. If you are not being malicious, then I apologize, but the only way I can interpret you seems to indicate you have an axe to grind. Let me provide an example of a language complexity that hinders education, presuming education cares about things common to many languages like function, types, con…
> I think you are intentionally simplifying my statements, and the intents of educators, in an intentionally disingenuous way. You're telling me that: (Pyret intervention) -> (educators not struggling with complexity) -> (education outcome) was so bad you think I'm dishonest? And you think that's the "only way" you can interpret the situation? And just in case you're wrong -- sorry? 1. Proposing a causal relationship…
This discussion clearly has too many factors to be argued by formal proof. We cannot prove our premises nor prove an argument is formally sound. Therefor we must rely heavily on induction as many trades do, both software development and teaching are trades in many regards. Each often requiring action without the time or ability to formally prove and instead relying on large scale informal experimentation. The very existence of unit tests demonstrates how clearly practical programming cannot be formally proven and the existence of the whole fields of psychology and sociology ought to serve as basis for teaching impossibility to formally prove. This seems so obvious I hadn't felt the need to state it previously.
I presumed you capable and understanding and knowing this. I inferred that someone choosing to represent the argument in such way must see the situation is too complex to break down like this and must be misrepresenting the facts or they must not be competent to discuss this topic. Because I presumed your competence I felt you must be misrepresenting the situation, I now see I was mistaken.
Re: Pyret – A language exploring scripting and functional programming
#224Earlier quoted context omitted.
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…
OTOH if your first language was Lisp (or even Python, to a lesser extent), and it was competently taught, the syntax of Java or C# would feel alien at first, but you'd find out that many of the concepts are already known to you; chances are, you even have an idea how they work under the hood.
(Disclaimer: I majored in embedded systems, my first languages were Fortran IV and PDP-11 assembly.)
Re: Pyret – A language exploring scripting and functional programming
#225Earlier quoted context omitted.
I think you are intentionally simplifying my statements, and the intents of educators, in an intentionally disingenuous way. If you are not being malicious, then I apologize, but the only way I can interpret you seems to indicate you have an axe to grind. Let me provide an example of a language complexity that hinders education, presuming education cares about things common to many languages like function, types, con…
> I think you are intentionally simplifying my statements, and the intents of educators, in an intentionally disingenuous way. You're telling me that: (Pyret intervention) -> (educators not struggling with complexity) -> (education outcome) was so bad you think I'm dishonest? And you think that's the "only way" you can interpret the situation? And just in case you're wrong -- sorry? 1. Proposing a causal relationship…
Re: Pyret – A language exploring scripting and functional programming
#226Earlier quoted context omitted.
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/ S…
Thank you. I am not deep into Racket yet, but it requires concentration which I lack at the moment. Based on your suggestion, I'm going to stay focused and attempt to complete, instead of distracting myself. I started reading HtDP2e before finding the Edx. The MOOC helped reinforce what I was reading. I realized that through Racket, learning to program is a superior experience. This, compared to any other (popular) l…
Re: Pyret – A language exploring scripting and functional programming
#227Earlier quoted context omitted.
FOR NOW. We have a plan for making the indentation checked but it's not been our top priority, but it is on our stack. Languages take a while to cook. Welcome to the kitchen. (-:
I must admit to being a fan of the python approach. My example code above is obviously "wrong", and is immediately so in Python. In other languages it is valid, and then brings a burden for a reader of trying to determine why the indentation doesn't match the intent. Since code is read a lot more than it is written, that seems like pointless complications for no real benefit.
In Pyret, our goal is to enforce indentation but never make it semantic: i.e., there's an unambiguous place for every bit of code. You can select-all and hit Tab in the Pyret editor and it'll reindent your whole program according to the rules. We just haven't yet implemented the checker for these rules (in part because we still don't all agree on exactly what they will be). Once we agree, the program you wrote would be a syntax error, but a user could have the system automatically indent it for them to make it right. (Even now, they can have the line be automatically indented for them.)
Re: Pyret – A language exploring scripting and functional programming
#228So, 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.
- avoids the duplicate class hierarchies you get with xUnit,
- avoids having to expose class internals for testing,
- makes tests an integral part of code, instead of an external add-on.
Re: Pyret – A language exploring scripting and functional programming
#229Earlier quoted context omitted.
I don't think you've responded to the most important point made by the parent, which is that any pedagogical value provided by a pedagogically-designed language over an engineering-designed language must be very substantial to offset the specified costs. You have drawn privileged lines of your own across programming languages by suggesting that languages designed for education are better in the education context, and…
1. Python has strange scoping rules. They are certainly not clean and nicely orthogonal. They complicate the ability to build basic tools and make them correct (e.g., see the appendix of http://cs.brown.edu/~sk/Publications/Papers/Published/pmmwpl... ). 2. Python does not offer a neat integrated testing story. 3. Python does not have a type-like annotation mechanism along with a type-checker and a type system that is…
I've always thought that the advantage of Python (or even JavaScript) as a first language is that you can defer thinking about (to the layperson) unintuitive concepts like types, and focus on the core concepts behind telling a computer to do what you tell it to. (Functions, variables, control flow, maybe classes if you're feeling fancy).
I've talked to a super-smart Hack Reactor graduate who was blown away by the concept of static typing when I explained it to him in detail; it was simply irrelevant to his understanding of functional programming, data structures, and algorithms, subjects which familiar with at quite a high level.
On 2), what's missing in Python beyond the unittest package?
On 4) and 5), are these things that you introduce early in your curriculum? They seem like quite niche aspects of programming. I've found that most python programmers haven't had cause to use an event loop in production, for example; only really if you're implementing a web server or networking stack, something that frameworks usually abstract from you.
Re: Pyret – A language exploring scripting and functional programming
#230Earlier quoted context omitted.
"def" is an abbreviation non-programmers are more likely to understand than "fun".
You're right ! To DEFine a FUNction, you should naturally type `def`, not `fun`. By the way, I tried to define a variable and got >>> def x = 3 File " ", line 1 def x = 3 ^ SyntaxError: invalid syntax What's up with that? Is that not also a DEFinition?