[ prog / sol / mona ]

prog


(Strong Static vs Weak Dynamic) -> Typesystems

1 2024-10-02 19:54

Strong Static vs Weak Dynamic Typesystems

what's your opinion & based take on this?

I would like to rant here and honestly describe my feelings & story.
My first first programming language was MS-DOS command line & editing batch files. I liked it. When I was around 12 probably maybe. Then we studied informatics in class and did some graphical geometric programming language (like move Point X, Y to X, T coordinate to draw); Then later I coded some Pascal in school, and did short screen splash scene like intro with sounds from PC motherboard speaker. Many ppl were excited to become Delfi developers back then. Upon graduating school, didn't had money for college/uni, I needed to get a job, I browsed job board website found 30 offers for C++ & 150+ for Java. I bought the marketing of 'compile once run everywhere' + free crossplatform jdk+ide, at that time I was a linux user and was unable to sell sould to asp.net C# (& they had small job numbers). So I started to learn "Java in 24h" book, done & learned it, only to find out no one needed me at job market with basic SE, and everyone asked for J2EE EJB Servlets book didn't covered. So despite I wrote few successfull programs I didn't got a job as java dev. I didn't learned/touched/concerned about manual memory management, safety pointers at that point. My only complain was slow GC & long burreaucratic boilerplates Classes OOP to do simple things.
Later then I discovered ruby/python/shellscripts. & omg my productivity skyrocketed, I was able to write useful oneliners and accomplish stuff without writing 2 pages of Java classes. only complain was that IDE (PyCharm) did not static analysis, typechecking, highlights, hower hints popups like Eclipse for Java, and I had to discover & test errors at runtime , but that wasn't big deal for me. And I got the relevant jobs.
(jumping back in time) I need to point out that before learning scripting weak dynamic langs, I've tried to write some programs at work to do useful meaningful work tasks like [working with excel|csv|text|log file, process, grep|edit|sed strings] in ... Java, because I didn't knew perl/python/sed/grep/awk/ruby/shell scripts back than... and it was afwul Class expirience. Massive strong statically typed boilerplates of Classes to do concatenation of strings, or remove spaces. Don't blame Java, it could have been C#/C++ or same shit (idk how bout Rust or Haskell?) at her place.

Don't get me wrong, those cli apps/tools, I wrote for prod, they are not throw away, they are well documented and being used later by dozens of emploiees. so that's not "undocumented one liner throw scripts" like public static void debiloid on hackernews love to blame dynamic scripting langs.

I've noticed that the whole marketing idea (of strong statically typed langs) and justification of pain of writing hard to read boilerplates is Fear Uncertainty & Doubt of errors in runtime.

(I could expand my story more, let me know if you want or if I need) But my point now, that since around 2015 I faced really agressive hype marketing of strong statically typed langs (primarily functional like Haskell). So I decided to give it a try... I jumped in to Type System rabbit hole, and started to learning about curry howard hindley milner bullshit (I'm sorry for being bit dramatic), lambda cube, then trying to pick perfect lang (instrument) to do the development , and since Haskell wasn't perfect a top of the /\^3 , I was forced to look at more expressive typesystems of Coq, Agda, Homotopy type theory, Cubical Type theory, only later to discover that are no implementation of those mentioned langs suitable for production IO. That's how I end up with somewhat practical Idris. (it's review deserve his own separate thread I'm not going to make yet or spoil here) (And I'm not talking ITT about ATS, Lean, Clean & other solvent level Everclear bullshit u could get at gas station).
So what's the poing you may ask? What's the final statement, ending & conclusion? I agree with grugbrain.dev that helpful side of Eclipse IDE was dozen of helpful features. There is no Eclipse/Visual Studio support for Idris/Haskell. There are plugins for Idris for VSCode but they outdated as fuck and don't work , give many problems like:
- node js prevent from starting lsp
- terrible windows support even for MSYS2
- move from Idris1 to Idris2 could have been a mistake such as move from Python2 to 3 breaking many of previous features and new version is raw as fuck n incomplete.
- vscode extensions for statically typed idris throwing at me a lot of cryptic js errors I don't know how to fix. brilliant? paradox & irony
- I don't see good ide for Haskell, and taking my prev expirience in to account, I'm not sure IntelliJ extension will work flawlessly.
- I've used vim, emacs and honestly don't want to be bothered with their unfriendly shitty interface again!

& like ok, even other than awful IDE support, for overhyped, oversold langs, there are still pain of writing boilerplates, Idris doesn't have 'Derrive' like Haskell or .toString() eval() metaprogramming facilities like Python, so it requires to manually write a code for example to convert Bool, primitive datatypes, Records {dick:ts?!} to -> String and backward from String to code. If datatype have 10+ elements, you need to write 10+ lines of code for each to assign it with String, ridiculios.

So, there is like fuckton of problems with strong static typed langs, and I'm not even mentioning here problems of Nix, Rust, C++.

Is it worth it to buy agressive overhyped oversold marketing of strong typed langs (including elegant functional options, maybe Ocaml?) ? Guess the answer. Maybe convince, argue ITT.
And if you say "Hey man, it's just pain down the road if not doing strong static" . I remember Enterprises that hired 100+ Java/C# devs to write web pages, what other company did with 10 PHP devs. If you got more than 50k+$ for the project, sure, safeguard youself with strong static typing, whatever you want. We also got to be grateful to Kusaba, Futaba, and honor first perl/php bbs devs. The productivity equals amount of energy spent on writing a code /:/ amount of working program software output. Strong staticically typed langs do reduce productivity, even in the age of intellisense autotab & gpt, in comparison to rise of productivity of dynamic typesystems. Yes, the dynamic programming language is just like human English language (or GPT), you get full working program with few English words, and maybe with few errors , that you allowed to fix optionally with next iteration if you need, instead inconvinience of writing code in pure hard math expression of typesystem.

P.S.: & I also pay respect to untyped HLA, Forth, out of class C. APL is the greatest language ever existed. Other next big lang is not Rust, or some fancy mumbo jumbo whoop da whloop typesystem. It's plain human lang combined with NN AI GPT to output software apps.</thread>
God forgive me if I'm wrong, I wrote & code in good faith.

2 2024-10-02 23:35 *

and they say like "Oh! but out strong static typesystem will protect you from errors! fear! errrors! Beware!"
ok, we got gradual typing annotations for how long, like ... 10 years in .. python? and I don't know how long like in TS/JS, & other similiar langs.
I still did/had/got type errors for last 10 years from production level grade js/py 'official' packaged apps in stable ubuntu.
And before that, I still got type errors from strong static typed c#/java compiled production deployed apps, in runtime.

Nothing prevents from
(Just Nil|None|Nothing) = ?not_handle
or
(Either Left) = ?not_handle

the 'exceptional' not null but Nil|None cases still may not be handled properly, correctly even in strong static pure functional enforced zoo. E.g. the app logic code, developer interpretation of algorythm still allowed to be intrinsically bad, and nothing stopping him from writing bad batship undocumented garbage code in strong static pure fp.
still could be : lack of inline code documentation comments, bad uninformative unintuitive not helpful error messages.

what's more important - is ability to change code in place once app deploed, after receiveing an error/excepton. can be done for python/formatted_js/perl & co, but not for haskell/F#/Rust/compiledTS(JS) .

3 2024-10-03 06:49 *

Strong Dynamic type systems like in Common Lisp I think are the right thing.

4 2024-10-10 23:54

Computer memory is weak typed.
No such thing as a const.

5 2024-10-11 02:39

Type systems are a mere implementation detail. I want to program declaratively using a high level programming language such as English and let the code monkey "programmers" compile the English instructions to a lower level programming language such as Lisp and assembly.

6 2024-10-14 09:43

Do you like F*?
https://fstar-lang.org/

7 2024-10-15 11:54

>>4
Register x0 is constant

8 2024-10-17 07:50

>>7
I see you haven't experienced register failure, or tampering.

9 2024-10-20 11:40

x0 is not constant, xzr is.

10


VIP:

do not edit these