zlacker

[parent] [thread] 16 comments
1. pjmlp+(OP)[view] [source] 2025-08-22 12:12:26
As usual, lets revisit something that Pascal could do in 1976,

    type

    StatusCodes = (Success, Ongoing, Done)
Go in 2025,

    type StatusCodes int

    const (
        Success StatusCodes = iota
        Ongoing
        Done
    )
replies(3): >>thiht+3 >>torgin+u1 >>jen20+DR
2. thiht+3[view] [source] 2025-08-22 12:13:02
>>pjmlp+(OP)
Where's Pascal today?
replies(5): >>termin+D >>ofrzet+M >>dardea+c1 >>pjmlp+D1 >>kragen+Ou1
◧◩
3. termin+D[view] [source] [discussion] 2025-08-22 12:18:00
>>thiht+3
Just below Go with Perl in between. All above Fortran, all below Visual Basic.

https://www.tiobe.com/tiobe-index/

◧◩
4. ofrzet+M[view] [source] [discussion] 2025-08-22 12:19:17
>>thiht+3
It's alive and kicking, right? :) https://www.freepascal.org They even have a game engine that can compile to a WASM target: https://castle-engine.io/web
◧◩
5. dardea+c1[view] [source] [discussion] 2025-08-22 12:21:13
>>thiht+3
Ouch!! Pascal's lack of popularity certainly isn't due to the fact that it supports such nice enumerated types (or sets for that matter). I think he was just pointing out that such nice things have existed (and been known to exist) for a long time and that it's odd that a new language couldn't have borrowed the feature.
6. torgin+u1[view] [source] 2025-08-22 12:23:08
>>pjmlp+(OP)
Where do you put the comments on the Pascal version?
replies(1): >>pjmlp+P1
◧◩
7. pjmlp+D1[view] [source] [discussion] 2025-08-22 12:24:45
>>thiht+3
Being used by these folks, https://www.embarcadero.com/

If you prefer, I can provide the same example in C, C++, D, Java, C#, Scala, Kotlin, Swift, Rust, Nim, Zig, Odin.

replies(1): >>fuzzte+pk1
◧◩
8. pjmlp+P1[view] [source] [discussion] 2025-08-22 12:25:34
>>torgin+u1
Where you feel like it.
9. jen20+DR[view] [source] 2025-08-22 16:58:23
>>pjmlp+(OP)
If Pascal doesn't have required exhaustive pattern matching, it's no better than Go or C# in this regard.
replies(2): >>pjmlp+nV >>frou_d+uk1
◧◩
10. pjmlp+nV[view] [source] [discussion] 2025-08-22 17:16:57
>>jen20+DR
Go is the one being discussed as ignoring history.

C# thankfully was designed by someone that appreciates type systems, maybe you should revisit it.

replies(1): >>jen20+I01
◧◩◪
11. jen20+I01[view] [source] [discussion] 2025-08-22 17:47:40
>>pjmlp+nV
Not enough to add sum types or exhaustive pattern matching... now F# - that was appreciated by someone that appreciates type systems.
◧◩◪
12. fuzzte+pk1[view] [source] [discussion] 2025-08-22 19:16:21
>>pjmlp+D1
Please do. Would be interesting to read.
◧◩
13. frou_d+uk1[view] [source] [discussion] 2025-08-22 19:16:33
>>jen20+DR
Does Pascal's break down like this Go does?

    func f(x StatusCode) {
    }

    f(728347) // There's no such status. Whateverz, no compile error.
replies(1): >>Mawr+hR1
◧◩
14. kragen+Ou1[view] [source] [discussion] 2025-08-22 20:17:56
>>thiht+3
Pascal evolved into Modula-2, which Wirth then simplified into Oberon. His student Griesemer did his dissertation on extending Oberon for parallel programming on supercomputers. Concurrently, Pike found Modula-2 an inspiration for some languages he wrote in the 80s and 90s. He got together with Griesemer and Ken Thompson to rework one of those languages, Newsqueak, into Golang. So that's where Pascal is today.
◧◩◪
15. Mawr+hR1[view] [source] [discussion] 2025-08-22 22:31:31
>>frou_d+uk1
How often do you pass literals into your functions?

    f(728347) // There's no such status. Whateverz, no compile error.
    a := 728347
    f(a) // Compile error.
replies(1): >>frou_d+GH2
◧◩◪◨
16. frou_d+GH2[view] [source] [discussion] 2025-08-23 07:09:42
>>Mawr+hR1
The nature of Swiss cheese is that it can't be all hole and there has to be some non-hole too
replies(1): >>jen20+0f3
◧◩◪◨⬒
17. jen20+0f3[view] [source] [discussion] 2025-08-23 13:55:57
>>frou_d+GH2
Raclette is Swiss cheese without holes. That is proper ADT in this anaology.
[go to top]