zlacker

[parent] [thread] 2 comments
1. shagie+(OP)[view] [source] 2025-11-20 04:36:46
They were inherited from even older languages and meant pretty much the same thing there.

https://en.wikipedia.org/wiki/AWK#Match_pattern_from_command...

    #!/bin/sh
    
    pattern="$1"
    shift
    awk '/'"$pattern"'/ { print FILENAME ":" $0 }' "$@"
The $ notation for a variable in bash and awk... and BASIC...

    RIGHTS imm & def
    RIGHT$ (sexpr, aexpr)
    ...
    PRINT RIGHT$ ("APPLESOFT" + "WARE", 8)
    SOFIWARE
One might make the claim that EWD498 was correct... https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD498...

> It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

https://www.perl.com/pub/2007/12/06/soto-11.html/

> Now, however it was initially intended, I think BASIC turned out to be one of the first major scripting languages, especially the extended version that DEC put onto its minicomputers called BASIC/PLUS, which happily included recursive functions with arguments. I started out as a BASIC programmer. Some people would say that I’m permanently damaged. Some people are undoubtedly right.

... but it wasn't without previous examples that Perl went the way that it did with sigils.

replies(1): >>kstrau+12
2. kstrau+12[view] [source] 2025-11-20 04:56:18
>>shagie+(OP)
I'm familiar with those sigils from various places. Me on my childhood C64: "What does 'B dollar sign' mean?". It just boggles my mind that someone writing a brand new programming language would use them when there were English-like alternatives (like `my foo = keys barHash`). It was sometimes hard to remember what [sigil][name] was going to if you didn't already remember what [name]'s, erm, inherent type?, was. Like is $foo going to give me the string that was already in $foo, or perhaps the number of (occupied buckets)/(total buckets) if $foo is really a hash?

I was able to reason my way through these things and had luck writing reasonably large Perl programs. It did absolutely zero to help make devs' lives easier, though.

replies(1): >>shagie+p5
◧◩
3. shagie+p5[view] [source] [discussion] 2025-11-20 05:42:54
>>kstrau+12
In 1987, when your audience of bash and awk and sed users was looking for a language to bring those together and were familiar with them... why wouldn't you use them?

I would also contend that given the tools at the time (vt100 terminals without syntax highlighting being prevalent systems) sigils made it easier to write more on a line, provided easier visual recognition (for those familiar with the language) about the syntax, and provided for a more easily written lexer.

[go to top]