brownplt / pyret-lang

The Pyret language.
Other
1.06k stars 106 forks source link

cannot run pyret-npm on Windows #1583

Open lulugo19 opened 3 years ago

lulugo19 commented 3 years ago

I've installed the pyret-npm package on Windows 10. When I execute pyret I get the following error:

2021-04-21T14:33:55.182Z Connection error: Error: connect ENOENT /tmp/parley-lulugo/comm.sock.
[client]  2021-04-21T14:33:55.182Z You can try again, and the Pyret server may restart. If you see this error repeatedly, report it as a bug.

I tried to run it as admin and also looked if anything is blocking the port.

Then I tried to run pyret on WSL (Windows Subsytem Linux) and there the server starts, but the program can not be compiled:

Compiling worklist...Could not find builtin module image in any of /mnt/d/Projekte/teaching-languages/pyret/.pyret/compiled, /usr/lib/node_modules/pyret-npm/pyret-lang/build/phaseA/compiled

Maybe the npm package is outdated? Should I install it by cloning the repository etc. ?

jpolitz commented 3 years ago

Thanks for reporting this. I would expect WSL to work.

What program are you trying to run?

At the moment, some of the libraries on code.pyret.org aren't supported offline, and image is one of them, so if you have import image or include image in your program, that would explain the issue.

If not, and your program is just a print statement or something, then I'd ask what you get for listing the contents of /usr/lib/node_modules/pyret-npm/pyret-lang/build/phaseA/compiled, which might give some clues.

I'd be happy to hear more about what you're trying to do, though, and suggest workarounds.

lulugo19 commented 3 years ago

Yeah, I actually use the image library.

For my bachelor thesis in CS I examine teaching languages: Programming languages that are easy to learn and teach and Pyret is one of them.

For each teaching language I program the same 3 small games:

I've already done this for Pyret in the web editor, but I thought I'd try it offline too. Since the image library isn't supported offline I will leave it by that.

Thank you 😊

jpolitz commented 3 years ago

You're welcome! I would love to see your thesis it if you can share it when it is done!

On Wed, Apr 21, 2021 at 9:44 PM, lulugo19 < @.*** > wrote:

Yeah, I actually use the image library.

For my bachelor thesis in CS I examine teaching languages: Programming languages that are easy to learn and teach and Pyret is one of them.

For each teaching language I program the same 3 small games:

  • Tictactoe
  • Flappy Bird
  • a tamagochi like game

I've already done this for Pyret in the web editor, but I thought I'd try it offline too. Since the image library isn't supported offline I will leave it by that.

Thank you 😊

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/brownplt/pyret-lang/issues/1583#issuecomment-824533851 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAA5IUZDBF353JNXU5FIZ3DTJ6SRRANCNFSM43KQCA2A ).

lulugo19 commented 3 years ago

Yeah, I am writing it in German but I can share it anyway 😉

jpolitz commented 3 years ago

Hopefully @shriram's Duolingo prowess helps me understand the parts I can't get through on my own with translation tools :-)

shriram commented 3 years ago

Which languages are you comparing?

lulugo19 commented 3 years ago

Which languages are you comparing?

I am definitely comparing:

And I am still thinking about including these languages/platforms:

I am concentrating on languages that are solely created as teaching languages and I am trying to include a wide range of different paradigms and perspectives. The target group is wide open from children to students or anyone interested in programming.

Do you have any suggestions?

shriram commented 3 years ago

I would definitely include the student language levels of Racket, which not only fit your definition, but also predate many of these and inspired some of them, and embody several really important principles. See for instance

http://parentheticallyspeaking.org/articles/pedagogic-ide/

I'd never heard of GameChangineer before, and while the Web site design gives me a headache, it looks pretty intriguing. I expect it also hits edge cases pretty quickly and then falls off a steep cliff.

lulugo19 commented 3 years ago

Thank you, I have already heard about Racket and played with it a bit around some time ago. Now I will definitely have a closer look at its student language. Can you create games with Rackets student language? And the term Pedagogic IDE is new for me, it sounds very interesting.

Yeah GameChangineer is just something I discovered during my research. It's quite fun to play around with it and I love the idea of natural language programming.

lulugo19 commented 3 years ago

Hi there all, I finished my bachelor thesis. It can be found here: https://github.com/lulugo19/teaching-languages

The selection of Teaching Languages was very broad with languages for different target groups. So I concluded that every teaching language had major strengths and weaknesses.

For Pyret the biggest strengths are its IDE with its great interactivity and that it allows the user to really write Clean Code that is centered around unit tests. The biggest weaknesses compared to the other languages is its more difficult syntax and its weaknesses for constructionist learning which is learning by exploration and play.

lulugo19 commented 3 years ago

Hopefully @shriram's Duolingo prowess helps me understand the parts I can't get through on my own with translation tools :-)

Hi I finished my bachelor thesis, just wanted to let you know!

shriram commented 3 years ago

Thank you, and congratulations!

Can you explain your "difficult syntax" comment? Do you mean the lack of blocks? (If so, that is, of course, a valid comment, though we do have a block version in progress.)

Can you provide a citation of some sort so we can advertise your thesis?

lulugo19 commented 3 years ago

Yeah, so I have 13 different assesssment areas with different evaluation criteria and one of them is called 'Intuitiveness of syntax and natural language' which is mainly based on this study that shows that a more intutitive based syntax can help beginners to learn a programming language with more ease:

Stefik, Andreas, and Susanna Siebert. "An empirical investigation into programming language syntax." ACM Transactions on Computing Education (TOCE) 13.4 (2013)

It's really about how natural an easy the syntax is. For this area I really don't have hard criteria. For Pyret I evaluated this area on page 73. I included a code sample of rather unintuitive syntax code. I also criticised that there are sort of three different ways of writing Lambdas. The lam-syntax the bracket syntax and the curried shorthand. Also the pattern matching with cases where you have to include the whole type so that gradual typing works is kinda difficult syntax.

The positives are the trailing return type , the use of the minus sign as part of an identifier and the very natural syntax of the logic operators or and and.

So it's really about how easy it is for absolute beginners to intuitivly understand the program based on the syntax and in this regard Pyret is comparitively hard. It's the case that the other languages are for a younger audience and mostly imperatively and that functional languages are generally not so easily picked up by absolute beginners . That's why Pyret doesn't come off as well in this area.

I don't know how to create a citation. I haven't had the presentation with my prof yet. I've published the thesis on Github but no where else yet. Is it possible to create a citation based on Github? I will talk with my prof about publishing it but he's on vacation right now and it may take a while.

shriram commented 3 years ago

Thank you for these detailed comments.

My German is about a millionth of your English, and to some extent I have taken help from Google Translate, both of which are flaky sources. (-: But I'm really impressed by the depth and thoroughness of your document.

That said, a few responses to the above comments, if you don't mind.

  1. I don't think we can use terms like "intuitive" or even "beginner" freely. The former is very subjective, the latter very contextual. For instance, it depends on what setting one is introducing programming. By most measures, the highly parenthetical syntax of Racket/Scheme/Lisp would probably be considered highly "unintuitive". But in Bootstrap:Algebra, it turns out this is the perfect syntax for illustrating some key concepts in math classes—to the point where some people greatly dislike Racket relative to Pyret because they prefer the parenthetical syntax. Thus, one paper doesn't get to determine concepts like "intuitive", just as even Turing didn't get to define computational "completeness"—we say Turing-complete, not "complete". So the same way, perhaps there is a Stefik-Siebert-intuitiveness, but that is not necessarily a universal notion, and almost certainly is not contextual (especially for the context for which we are creating).

  2. It is frankly unclear to me that syntactic aliases are a problem. It all depends on the pedagogy. In DrRacket, we created the notion of "language levels" so that we could introduce things progressively. Pyret does not (yet) have them, but we follow such a principle in our teaching/book. The existence of an alias syntax is not much of an issue if students don't see it or stumble on it.

  3. I don't think there is any evidence for the claim about functional languages and beginners. In fact, we use functional programming because in our context of mathematics classes—well, guess what, mathematics is functional. It's the imperative languages that are "unintuitive", and mess up all the concepts students are learning: variable, function, etc.

  4. Finally, Pyret is also a full-blown imperative language for people who want to program that way. We devote a chunk of space in PAPL [https://papl.cs.brown.edu]—one of the longest chapters, actually—to programming with state. I would argue that languages without good functional support are actually the weak ones here, because they do not give the teacher curricular choice, and force them to use concepts that are a bad fit with—almost contradictory to—some common contexts, such as math classes.