|
Smoke_Max posted:I'm not sure about structural typing, but row polymorphism can definitely be done in a type-safe way. An example of a language that does it is Purescript, where, as an added bonus, it can also be inferred. you absolutely can, but no one on the pro static types side is talking about purescript's type system
|
# ? Feb 26, 2017 22:53 |
|
|
# ? May 22, 2024 09:43 |
|
tef posted:i mean i can go back to yelling about deferred type errors, or threesomes with blame, or row polymorphism, or higher kinded types tef posted:i mean i can go back to yelling about deferred type errors, or threesomes with blame, or row polymorphism, or higher kinded types lol this post is so bad
|
# ? Feb 26, 2017 22:53 |
|
tef posted:you fucks haven't even written a program in constraints and you're telling me to use this pissy little backwards rear end homebrew ad-hoc theorem prover to demonstrate some subset of correctness and you're the ones getting mad at me for not verifying my program in crayon tef posted:i'm not hostile, i'm not hostile, i yell into the green and black void you uh, doing okay over there tef?
|
# ? Feb 26, 2017 22:53 |
|
tbh it's probably just the honeymoon phase i'm still in with elixir, but i'm starting to think it's not static languages i like so much as compiled ones. being able to catch problems before runtime is great, static typing is just one way to accomplish that.
|
# ? Feb 26, 2017 22:57 |
|
abraham linksys posted:there's other stuff i want from my tools that typing doesn't check. my biggest pain point as a web developer is that i wish i had checks that i'm correctly consuming or producing the resources for a REST API, and I want these checks to exist at runtime, too. you need to make a fuckload of assumptions to make this work well, though, so idk if it's a reasonable request. it's a nice dream though. Say, have you heard of SOAP?
|
# ? Feb 26, 2017 23:06 |
|
tef posted:i'm not hostile, i'm not hostile, i yell into the green and black void green?!
|
# ? Feb 26, 2017 23:07 |
|
Honestly I feel like immutability is more important than static typing. fight me
|
# ? Feb 26, 2017 23:29 |
|
You can't have immutability without static typing, though, surely?
|
# ? Feb 26, 2017 23:41 |
|
Doom Mathematic posted:You can't have immutability without static typing, though, surely? Sure you can. All immutability guarantees is that you can't mutate a piece of data, its' shape could change, be updated, whatever, but that's still immutable.
|
# ? Feb 26, 2017 23:46 |
|
Doom Mathematic posted:You can't have immutability without static typing, though, surely? Racket has a bunch of immutable data structures that have nothing to do with Typed Racket or with using contracts. Structs are immutable by default, as are pairs (i.e. cons).
|
# ? Feb 26, 2017 23:46 |
|
Doom Mathematic posted:You can't have immutability without static typing, though, surely? erlang and elixir say hi
|
# ? Feb 26, 2017 23:50 |
|
Destroyenator posted:the other thing a good type system can give you is a more explicit modelling of your problem space Like, I see where you're coming from, but... code:
Maluco Marinero posted:Honestly I feel like immutability is more important than static typing.
|
# ? Feb 26, 2017 23:53 |
|
Maluco Marinero posted:Honestly I feel like immutability is more important than static typing. yeah, knowing nothing is going to get changed behind my back because i passed it to a mutating function is huge.
|
# ? Feb 26, 2017 23:54 |
|
abraham linksys posted:i just treat static typing as a really smart linter. works out okay. typescript is basically just eslint except you add a few special bits to your code that get stripped away. also as an added bonus, my text editor can do smarter things like tell me how to use a method in a third party api. i treat everything written in ruby as a potential bomb that could destroy everything at any time double so for dsls like chef
|
# ? Feb 27, 2017 00:10 |
|
i got started on a Haskell database migration thing, but i kinda just got bored and stopped working on it before it was done, just like every thing else that i start. if anyone wants to take a look at it, it's here. code:
|
# ? Feb 27, 2017 00:22 |
|
Maluco Marinero posted:Sure you can. All immutability guarantees is that you can't mutate a piece of data, its' shape could change, be updated, whatever, but that's still immutable. I don't see how changing the shape of a piece of data or updating it doesn't count as mutating it. Could you give an example?
|
# ? Feb 27, 2017 00:27 |
|
ok so what are the actual advantages of dynamic typing? what would make me want to go from my obviously dumb and lovely static typing to a more dynamic type system?
|
# ? Feb 27, 2017 00:29 |
|
redleader posted:ok so what are the actual advantages of dynamic typing? what would make me want to go from my obviously dumb and lovely static typing to a more dynamic type system? Macros edit: vvv I know they are not mutually exclusive per se, but you are going to have a hard time finding them fully featured just side-by-side. Since that's a Racket-ish system, note that Typed Racket doesn't deal too well with Racket macros at the moment, as one example. Hollow Talk fucked around with this message at 00:42 on Feb 27, 2017 |
# ? Feb 27, 2017 00:36 |
|
https://github.com/lexi-lambda/hackett begs to differ
|
# ? Feb 27, 2017 00:38 |
|
Doom Mathematic posted:I don't see how changing the shape of a piece of data or updating it doesn't count as mutating it. Could you give an example? Mutable. code:
code:
|
# ? Feb 27, 2017 00:51 |
|
jony neuemonic posted:you uh, doing okay over there tef? not really but i think i've been exposed to far more frothing fp zealots than other people
|
# ? Feb 27, 2017 01:31 |
|
i guess i was trying to say that there's a bunch of cool static analysis and research but my experience in using most type systems is often frustration
|
# ? Feb 27, 2017 01:35 |
|
Doom Mathematic posted:Say, have you heard of SOAP? It really is amazing to think how much of programming is people (including myself ofc) migrating to the frameworks whose tradeoffs they haven't personally experienced yet. I'm sick of this tight coupling time to go non-relational/JSON! I'm sick of having poo poo contracts time to go SOAP/RMI! Wait now I've got it, REST with XML payloads! JSON schemas! TheresNoThyme fucked around with this message at 01:45 on Feb 27, 2017 |
# ? Feb 27, 2017 01:36 |
|
btw blame wadler for the threesomes thing: http://homepages.inf.ed.ac.uk/wadler/papers/threesomes-popl/threesomes-popl.pdf The threesomes presented in this paper provide a streamlined data structure and algorithm for representing and normalizing coercions. Furthermore, threesomes provide a typed-based explanation of coercion reduction.
|
# ? Feb 27, 2017 01:39 |
|
Hollow Talk posted:Macros no, seriously
|
# ? Feb 27, 2017 02:04 |
|
Maluco Marinero posted:Mutable. Okay, this is a definition of "mutation" which I wasn't previously aware of. I mean, thing hasn't changed at all (or "mutated", as it were) in your second example. You haven't updated it, you've just created a second, also-immutable object derived from it.
|
# ? Feb 27, 2017 02:10 |
|
reminder that the only problem with mutation is reference semantics, but fp ideology has been throwing the baby out with the bathwater for almost thirty years
|
# ? Feb 27, 2017 02:14 |
|
tef posted:i guess i was trying to say that there's a bunch of cool static analysis and research but my experience in using most type systems is often frustration im super curious why tho. like, how does every single statically typed lang youve used cause you frustration? TheresNoThyme posted:It really is amazing to think how much of programming is people (including myself ofc) migrating to the frameworks whose tradeoffs they haven't personally experienced yet. the right answer is whatever your company uses to create rpc clients/servers. if your company is internally vending REST apis with "discoverable" specs you should probably leave because they're more beholden to dumb principles than productivity
|
# ? Feb 27, 2017 02:18 |
|
rjmccall posted:which dynamically typed languages are you thinking of exactly that aren't centered around object-oriented programming, because oop is pretty core to python, ruby, and javascript and yes, I know people have created OOP-like frameworks in javascript with inheritance.
|
# ? Feb 27, 2017 02:18 |
|
rjmccall posted:reminder that the only problem with mutation is reference semantics, but fp ideology has been throwing the baby out with the bathwater for almost thirty years it lets you use mutability where it's the best fit for the problem and lets you use immutability where it's the best fit for the problem. the best benefits for immutability in general for me is locality of reasoning and I think rust handles that in a lot of cases through preventing aliasing and its immutability guarantees.
|
# ? Feb 27, 2017 02:20 |
|
jony neuemonic posted:tbh it's probably just the honeymoon phase i'm still in with elixir, but i'm starting to think it's not static languages i like so much as compiled ones. being able to catch problems before runtime is great, static typing is just one way to accomplish that. of course, you can have some hybrid approach of static and dynamic typing. I think it's kind of a sliding scale between how much your language embraces static and dynamic typing.
|
# ? Feb 27, 2017 02:24 |
|
Hollow Talk posted:Macros https://doc.rust-lang.org/beta/book/macros.html You might not be able to do all the stuff with macros you could in Common Lisp and it's not homoiconic, but it might be good enough. Even if rust doesn't do everything you'd want, you could probably imagine a statically typed language that could in practice do so.
|
# ? Feb 27, 2017 02:29 |
|
FamDav posted:the right answer is whatever your company uses to create rpc clients/servers. if your company is internally vending REST apis with "discoverable" specs you should probably leave because they're more beholden to dumb principles than productivity Well, any company doing SOA stuff for > 5 years will have several options in my experience, some of them might even be for good reason (meaning the tradeoffs were actually considered). I'm part of a team that maintains SOAP services with dedicated infrastructure devices, internal webservices using native RPC calls, as well as public API's with plain old REST + JSON and oauth. We are slowly retiring the RMI stuff. That said I agree discoverability in REST is more pain than it's worth. One of these days I'll do a personal project in HATEOAS just to experience it for myself though. TheresNoThyme fucked around with this message at 03:09 on Feb 27, 2017 |
# ? Feb 27, 2017 02:37 |
|
redleader posted:ok so what are the actual advantages of dynamic typing? what would make me want to go from my obviously dumb and lovely static typing to a more dynamic type system?
comedyblissoption fucked around with this message at 02:47 on Feb 27, 2017 |
# ? Feb 27, 2017 02:43 |
|
FamDav posted:im super curious why tho. like, how does every single statically typed lang youve used cause you frustration? from the list above: comedyblissoption posted:
for the bullshit code i've been writing (heavy amounts of automation and third party interop), it's rarely worth it
|
# ? Feb 27, 2017 02:55 |
|
throw in a "languages with good type systems tend to lean towards ADTs and not OO-esque styles", which is great except when sometimes OO-esque is better (foreign data or apis) also i am in a nightmare world with thousands of types but all of them are differently formatted strings
|
# ? Feb 27, 2017 03:05 |
|
people will disagree about it being a good thing but I think dynamically typed languages tend to be easier for first time programmers. there's a lot of learning that goes into understanding object casting and, more fundamentally, it takes time to reach a level where you feel comfortable exploring a programming API in order to hunt down that toInteger function. hell in my first year of programming just typing syntactically correct code inside an IDE took a lot of time.
|
# ? Feb 27, 2017 03:06 |
|
comedyblissoption posted:I'm an incredibly statically typed language bigot, so these are literally the only things I can think of: ps thank you for this list it is better than what i've been trying to whine about
|
# ? Feb 27, 2017 03:08 |
|
comedyblissoption posted:they have OOP concepts, but programmers in these languages are much more likely to compose their programs out of functions instead of a bunch of interwoven mutable objects with absurd inheritance trees AFAIK. it's more of a cultural thing. oh right, i'm here, welp
|
# ? Feb 27, 2017 03:09 |
|
|
# ? May 22, 2024 09:43 |
|
TheresNoThyme posted:people will disagree about it being a good thing but I think dynamically typed languages tend to be easier for first time programmers. there's a lot of learning that goes into understanding object casting and, more fundamentally, it takes time to reach a level where you feel comfortable exploring a programming API in order to hunt down that toInteger function. hell in my first year of programming just typing syntactically correct code inside an IDE took a lot of time. in some ways scratch is a statically typed language because you can't just mash the blocks together, and benefits wildly from it
|
# ? Feb 27, 2017 03:11 |