Live data from Hacker News

Pike – a dynamic programming language with a syntax similar to Java and C

pike.lysator.liu.se

31–40 of 75 posts

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#31
post #8

I remember coming across Pike about two decades ago (or more), as a young amateur developer... I couldn't understand why anyone would choose Pike. And today I still can't. Legacy projects?

It always seemed like a MUD language project that tried to recycle its efforts by taking on Python, Ruby, etc. There’s literally no reason to use this language unless you want to make MUD games or are just purely curious about the project.

I mean let's be fair: back then MUD nerds were using LambdaMOO's "moo" language and LPmud's "LPC" before things like Python were mainstream or serious, Perl pre-5.0 was terrifying and limited, and Ruby wasn't even on the radar.

So when we went to go do "serious" work we kinda missed them.

Your options in 1991, 92, 93 were earlier perls, shell + awk/sed, or maybe tcl or a lisp/scheme if you were lucky.

The languages inside those MUDs actually were ahead of their time, and their programming model -- in the case of MOO [and its offshoots CoolMUD and ColdMUD] at least -- was more similar to advanced systems like Smalltalk or Self which were hot interesting topics at the time.

Being "confined" to being "game" languages made them not get taken seriously (unlike "JavaScript" which arrived with all sorts of weird warts but had Netscape's brand on it), so the LPC people tried to make it into a "serious" language in the form of Pike, and it's not half bad?

By the late 90s, obviously things had changed. If somebody in a successful "serious" company had adopted Pike/LPC it could easily have had an alternative history where they became commonly used instead of perl5 or php on the early web. (It took Python a decade to get serious headspace there.)

(Gratuitous plug for my LambdaMOO defibrilation: http://github.com/rdaum/moor)

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#32
post #4

Taking the worst aspect of statically typed languages and mixing it with the worst part of dynamic schemes. I'll keep my Ruby, thanks.

Might be helpful to expand on what you mean specifically by the worst parts in your view and how Ruby's decisions provide better trade offs.

Worst part of static compiled languages is the ugly syntax. Worst part of dynamic systems is they aren't machine-understandable. It's a direct tradeoff that results from formal language theory. Ruby isn't an answer to this, in fact it lies so far on the dynamic side of the fence that the one IDE targeted at it is more of an impediment than a help. There is no answer to the tradeoff, though there are a few current attempts, like Zest.

I personally don't need or want a computer to help me to understand the code I work on. It would be nice but not worth the need for a compile step. Pike looks like a compiled language, but doesn't even try to give you any of the advantages of machine understandability. It's purely cosmetic, why in the world would anyone want Python to look like C? If you want a dynamic language and don't want to deal with Ruby's... eccentricities, just use Python like everyone else.

https://github.com/jamii/zest

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#33

Earlier quoted context omitted.

Ruby has static type system if I ever want to use it.

Crystal has static type-checking though. It is built into the language, unlike Ruby. Ruby is a dynamically typed language unlike Crystal. What am I misunderstanding here?

Ruby's static type checker is built into the language, since 3.0.

https://github.com/ruby/rbs

You can use others if you like. I have used Crystal before, pretty quickly realized that it was never going to catch up with Ruby and the compile step isn't really all that much of an advantage. The few scripts that I want speed for, I just use mruby. Embed Ruby in C, runs super fast. Don't get all the cool Ruby libs or runtime reflection. But a way better tradeoff.

https://mruby.org/

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#34
post #29

Pike is described as a "dynamic" language, so I was expecting purely dynamic typing, yet the language uses Java/C-style variable declarations with explicit types. It seems that these are (unsound) type hints , years before TypeScript made them cool: > "If your program tries to put one type of value in a variable which was designed to hold another type of value, Pike may detect this" [emphasis mine] https://pike.lysat…

Groovy has that too and it's quite the anti-feature. Pretend static typing is worse than useless, it's the MAC-10 of footguns.

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#35

Earlier quoted context omitted.

Crystal has static type-checking though. It is built into the language, unlike Ruby. Ruby is a dynamically typed language unlike Crystal. What am I misunderstanding here?

Ruby's static type checker is built into the language, since 3.0. https://github.com/ruby/rbs You can use others if you like. I have used Crystal before, pretty quickly realized that it was never going to catch up with Ruby and the compile step isn't really all that much of an advantage. The few scripts that I want speed for, I just use mruby. Embed Ruby in C, runs super fast. Don't get all the cool Ruby libs or runt…

Oh, thank you!

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#36
post #29

Pike is described as a "dynamic" language, so I was expecting purely dynamic typing, yet the language uses Java/C-style variable declarations with explicit types. It seems that these are (unsound) type hints , years before TypeScript made them cool: > "If your program tries to put one type of value in a variable which was designed to hold another type of value, Pike may detect this" [emphasis mine] https://pike.lysat…

Not sure what they are referring to, but it may be that you can declare things as having one of several types (e.g. int|string|void) or even that something can be any type at all (i.e. turn off static type-checking for that thing)? I do not think the type-checker will ever randomly decide to just not check a type given that you have provided types for it to check, but it was a long time ago since I had to read or write any Pike code.

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#37
post #29

Pike is described as a "dynamic" language, so I was expecting purely dynamic typing, yet the language uses Java/C-style variable declarations with explicit types. It seems that these are (unsound) type hints , years before TypeScript made them cool: > "If your program tries to put one type of value in a variable which was designed to hold another type of value, Pike may detect this" [emphasis mine] https://pike.lysat…

Not sure what they are referring to, but it may be that you can declare things as having one of several types (e.g. int|string|void) or even that something can be any type at all (i.e. turn off static type-checking for that thing)? I do not think the type-checker will ever randomly decide to just not check a type given that you have provided types for it to check, but it was a long time ago since I had to read or wri…

I can turn off static type checking for a thing in C by using `void*`

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#38
post #29

Pike is described as a "dynamic" language, so I was expecting purely dynamic typing, yet the language uses Java/C-style variable declarations with explicit types. It seems that these are (unsound) type hints , years before TypeScript made them cool: > "If your program tries to put one type of value in a variable which was designed to hold another type of value, Pike may detect this" [emphasis mine] https://pike.lysat…

Groovy has that too and it's quite the anti-feature. Pretend static typing is worse than useless, it's the MAC-10 of footguns.

> it's the MAC-10 of footguns

At least it might be shooting Nulls.

Re: Pike – a dynamic programming language with a syntax similar to Java and C

#39

Earlier quoted context omitted.

It always seemed like a MUD language project that tried to recycle its efforts by taking on Python, Ruby, etc. There’s literally no reason to use this language unless you want to make MUD games or are just purely curious about the project.

I mean let's be fair: back then MUD nerds were using LambdaMOO's "moo" language and LPmud's "LPC" before things like Python were mainstream or serious, Perl pre-5.0 was terrifying and limited, and Ruby wasn't even on the radar. So when we went to go do "serious" work we kinda missed them. Your options in 1991, 92, 93 were earlier perls, shell + awk/sed, or maybe tcl or a lisp/scheme if you were lucky . The languages…

LambdaMOO was ahead of its time in many ways: lists are immutable, but there was a handy splice operator. Verbs could have aliases and wildcards or both, allowing for some interesting namespace-like behavior. Would have been nice if they could have completely decoupled the built in parser before development died off, but it should be a pretty simple task nowadays, and some places like E_MOO managed to soft-code some pretty decent parsers regardless.
Post reply on HN