Live data from Hacker News

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

pike.lysator.liu.se

71–75 of 75 posts

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

#71
post #67
post #62

Earlier quoted context omitted.

It was great for certain niche applications, like: * The Roxen web server * The Opera Mini backend service (150k CPU cores, 5k servers, 150k pageloads/s, 3 million inline fetches per second, 100+ Gbit/s - 15 years ago) I worked on both of those projects. Now I mostly program in Python. It's perhaps like 10x slower to run on average but since it won there's a module or three for anything so building stuff is faster. Y…

Python won because of its C interface was easy, so it's got Numpy, Scipy, Pytorch, OpenCV bindings, etc. For these use cases, the speed of the interpreter is mostly irrelevant. On the web dev front, Python was lucky to get easy bolted-on async I/O (via greenlets), so it was more performant than Ruby (which was really slow 10 years ago), and Django was less magical than RoR.

No, python had already won by the time django and numpy started.

Pike's C interface is better in most ways, but of course that might depend on tastes.

Python's easy syntax, accessible documentation, books and tutorials make the learning experience completely different. It's an excellent choice for low-effort small scripts and short-lived projects. It became widespread. At some point it started to be the chosen language in schools. Numpy and django (etc) followed from that.

Pike with modernised syntax (something like Swift?) could have been a contender web-language maybe 2005-2006 at the latest.

Pike's learning experience was always less welcoming. The module tree reference is great though.

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

#72
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…

The compiler will complain about incorrect types and (?) infer types where possible. "Mixed" types are resolved at runtime.

There is a strict_types mode that will increase warnings/errors.

One of the problems with Pike is that the mechanics of this and other things are effectively undocumented so you have to learn by experimenting and reading the source.

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

#73
post #69
post #7

Of all the strengths that Java and C have, I would not call syntax one of them. :) So this title seems quite strange. Not the sales pitch I would make. It is understandable though, considering this language is 30+ years old. Probably not the decision you would make if you were to design it today: Switch statement with labels+fallthrough instead of a switch/match expression (even Java replaced that one with a switch e…

pike is based on LPC which stands for "Lars Pensjö C" which was developed in 1989. at the time C dominated the language landscape. sufficiently popular alternatives were BASIC, pascal, lisp, smalltalk, TCL and perl. i don't think there was much else. at least in the unix world. lars probably was familiar with C and that's what he based the language on. i think python was really the first non-C-like language that beca…

I guess the other well-known syntax form at the time was the one in the Algol/Pascal/Ada/Modula-2 tradition with keywords (begin/end, if/endif, etc) for structuring blocks and that's what MOO cribbed from, while LPC (and later JavaScript, Java, etc.) did the braces thing.

At the time I liked braces a lot more but since then have come around to preferring the more Wirth-ish style. I think Julia has shown that a dynamic lisp-ish language can do this very elegantly.

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

#74

Earlier quoted context omitted.

Ah yes I forgot about $do_command, that’s what we used. For some reason I remember doing it with raw network read commands but that was a different MOO project now that I think about it. Nice to know some people are still doing MUD server dev, it’s a scene I haven’t been back to in a while.

Your name may be familiar.

Never went by my real name on MOOs, but I was on a bunch of them going originally by Phaedrus then Kirlan. I think on E_MOO I was going by Iluvatar. Prisoner #74469 on LambdaMOO, I still remember that. Probably still there, I can't imagine they do any more reaping in this current age when the whole thing can fit comfortably on a raspberry pi.

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

#75
post #67
post #62

Earlier quoted context omitted.

It was great for certain niche applications, like: * The Roxen web server * The Opera Mini backend service (150k CPU cores, 5k servers, 150k pageloads/s, 3 million inline fetches per second, 100+ Gbit/s - 15 years ago) I worked on both of those projects. Now I mostly program in Python. It's perhaps like 10x slower to run on average but since it won there's a module or three for anything so building stuff is faster. Y…

Python won because of its C interface was easy, so it's got Numpy, Scipy, Pytorch, OpenCV bindings, etc. For these use cases, the speed of the interpreter is mostly irrelevant. On the web dev front, Python was lucky to get easy bolted-on async I/O (via greenlets), so it was more performant than Ruby (which was really slow 10 years ago), and Django was less magical than RoR.

Compared to its closest once-competitors—Lua and Tcl—I’d say CPython’s C API is the worst of the bunch, ergonomically speaking. (Can’t say anything about Perl.)
Post reply on HN