6 ms·
haskell, ocaml, golang, rust, functools python, erlang, elixir, sql
by noloblo 4y ago
haskell,
ocaml,
golang,
rust,
functools python,
erlang,
elixir,
sql
- shoo 4y ago> functools python i'd argue that python is not one of the best languages at supporting modularity, because is is dynamically typed and duck typed, and by default there's no requirement for functions to say what type of thing they accept -- unlike languages that give you a way to declare "this function requires a thing A that implements interface B" -- and no mechanism to enforce it either. i completely agree that one can certainly write modular code in python, but doing so is far more error prone than certain other languages, as by default the language doesn't give you a way to enforce that code cannot start depending on implementation details of random things. maybe the closest thing is the protocol stuff (https://peps.python.org/pep-0544/ https://peps.python.org/pep-0544/), but of course python doesn't enforce any of these optional type annotations. in contrast if you bash out some go or java code using interfaces, the language gives you a lot more assistance in preventing you from bypassing the interface you're claiming to be depending upon. > sql i'd be very curious to see examples of modularity with sql. are there good ways of doing this in the sql standard, that are widely supported by implementations? one example - (albeit the bigquery/sql manifestation of sql): suppose you have a database that contains many tables and views. some of the tables and views are internal, part of the implementation, you want to avoid users directly depending on them so you can change them without notice. some of the tables and views are external, and are meant to be exposed to certain groups of users. this defines the external interface to accessing data. if you implement this in bigquery and give your users read access to the database, then there's no way to give them read access to some tables and views, and block them from others. so the language and technology doesn't give you one of the basic building blocks you need to define and enforce modularity
- noloblo 4y agoExactly on sql ;but functools py with my type might work?
- noloblo 4y agoCommon lisp, Racket, Bash too