|
CRIP EATIN BREAD posted:so I decided playing with rust again recently, and discovered this sort of behavior: haskell (with no extensions), f# (without subtyping) scala 3 (dotty) without subtyping ocaml rust uses a variant mercury agda, idris et al have a more powerful version basically any statically typed functional lang uses it or at least uses it as a starting point before bolting their own stuff on top of it (rust's lifetimes, the dependent typed stuff, any oo stuff, etc). it doesn't work great with oo inheritance so scala and f#'s version is less useful when that stuff comes into play (also gently caress scala implicits) e: see https://www.quora.com/What-are-all-the-programming-languages-that-have-type-inference
|
# ? Feb 20, 2019 23:13 |
|
|
# ? Apr 19, 2024 06:38 |
|
if oo subtyping is too confusing for your type inferences it's too confusing for you
|
# ? Feb 20, 2019 23:16 |
|
DONT THREAD ON ME posted:if oo subtyping is too confusing for your type inferences it's too confusing for you to be more specific I think it's an inherent limitation of dynamic dispatch
|
# ? Feb 20, 2019 23:19 |
|
With functional langs, it makes sense to me to have that type inference. Like inferring:code:
I guess I just haven't seen too many non-functional langs do that sort of thing.
|
# ? Feb 20, 2019 23:20 |
|
go, c++, c#, java all have limited type inference using var/auto but the key difference (and the entire thing that makes HM worth using) is that HM basically builds up a collection of constraints on a generic type, and then only tries to work out the actual type after it's seen all its usages and it keeps it as generic as possible. those non HM langs generally look forward for 1 usage and then pick that as the inferred type going forwards or worse only look at the exact concrete type on the right hand of an assignment.
|
# ? Feb 20, 2019 23:22 |
|
CRIP EATIN BREAD posted:With functional langs, it makes sense to me to have that type inference. Like inferring: it's really not *that* different from using auto in c++ or var c# although i'm sure both are more limited, like i dont think you could do: code:
e: oh yeah as gonadic io says in other langs it feels like the inference only goes one or two steps ahead wheras with HM it's "solving" for your type. DONT THREAD ON ME fucked around with this message at 23:25 on Feb 20, 2019 |
# ? Feb 20, 2019 23:23 |
|
swift can do the object instantiation if you conform to any of the ExpressibleBy[...]Literal protocols https://developer.apple.com/documentation/swift/swift_standard_library/initialization_with_literals
|
# ? Feb 20, 2019 23:35 |
|
DONT THREAD ON ME posted:IIRC Rust uses Hindley–Milner (or something close) for type inference, so other langs using that. Haskell I think. never got to use such a language but the idea that poo poo i write later in the code specifies the type of poo poo i wrote earlier feels weird and counter-intuitive maybe its just great in practice though, i dunno
|
# ? Feb 20, 2019 23:56 |
|
DONT THREAD ON ME posted:it's really not *that* different from using auto in c++ or var c# although i'm sure both are more limited, like i dont think you could do: yeah it makes sense. it's not like it can propagate down really far, i'm just not used to seeing that work correctly in an imperative setting
|
# ? Feb 21, 2019 00:10 |
|
Zlodo posted:never got to use such a language but the idea that poo poo i write later in the code specifies the type of poo poo i wrote earlier feels weird and counter-intuitive you can always choose to specify the type. in haskell all top level items (i.e. functions, constants, etc) should have explicit type params and it's a warning for them not to, so the uncertainty/unspecifiedness you talk about only exists inside a function block. in f# it's common to leave them all off entirely even for exported types and i don't like it at all
|
# ? Feb 21, 2019 00:11 |
|
Zlodo posted:never got to use such a language but the idea that poo poo i write later in the code specifies the type of poo poo i wrote earlier feels weird and counter-intuitive a lot of functional programming features can be like that at first, but they are fairly neat in practice have a look at Prolog for even weirder (but related) programming paradigms e: here's a quick c/p from wikipedia: quote:In Prolog, program logic is expressed in terms of relations, and a computation is initiated by running a query over these relations. Relations and queries are constructed using Prolog's single data type, the term. Relations are defined by clauses. Given a query, the Prolog engine attempts to find a resolution refutation of the negated query. If the negated query can be refuted, i.e., an instantiation for all free variables is found that makes the union of clauses and the singleton set consisting of the negated query false, it follows that the original query, with the found instantiation applied, is a logical consequence of the program. This makes Prolog (and other logic programming languages) particularly useful for database, symbolic mathematics, and language parsing applications. Because Prolog allows impure predicates, checking the truth value of certain special predicates may have some deliberate side effect, such as printing a value to the screen. Because of this, the programmer is permitted to use some amount of conventional imperative programming when the logical paradigm is inconvenient. It has a purely logical subset, called "pure Prolog", as well as a number of extralogical features. Private Speech fucked around with this message at 00:31 on Feb 21, 2019 |
# ? Feb 21, 2019 00:18 |
|
Krankenstyle posted:lmao i just force pushed 3 times because i kept finding more elegant ways of writing various things sounds like my feature branches tbh. when I finally finish this loving thing I've been doing it's gonna be a huuuuuge pack of changes for merging shame we have zero regression tests to validate I didn't gently caress something up 2 months ago and forget about it!
|
# ? Feb 21, 2019 00:39 |
|
Private Speech posted:a lot of functional programming features can be like that at first, but they are fairly neat in practice now imagine prolog but with lisplike syntax now you have microprolog and by extension Fril
|
# ? Feb 21, 2019 00:53 |
|
Symbolic Butt posted:oh there's a 'trick' here, you probably should check it with lua_type like yeah, that's what i ended up doing. just registering my horror at having a function called lua_isstring that doesn't test whether the thing is a string or not. i mean i can see what they were going for, it's not so much "is it a string" as "will lua_tostring return a non-null result" and i guess that's reasonable? but then lua_tostring is also badly designed (let's convert numbers to strings, but not anything else even if it has a __tostring metamethod. and if we convert a number to a string, let's also modify the original number on the stack, loving up anything that was relying on it staying a number, because ... reasons? idk why anyone would ever want this.) lua is so bad and it's past midnight again and i'm still obsessively integrating it into my dumb hoby project. i think this might be a cry for help
|
# ? Feb 21, 2019 01:37 |
|
Powerful Two-Hander posted:shame we have zero regression tests to validate I didn't gently caress something up 2 months ago and forget about it! it’s ok, you probably did but if you codebase has no automated tests it’s not your fault for breaking something, unless you are the one responsible for there being zero tests
|
# ? Feb 21, 2019 01:58 |
Okay, which goon wrote the Google python style guide?Section 2.1.4 posted:Make sure you run pylint on your code.
|
|
# ? Feb 21, 2019 03:07 |
|
AggressivelyStupid posted:now imagine prolog but with lisplike syntax I'm thinking I'll write something with SWI-Prolog for my last week at work they screwed me out of vacation and have me working overtime a lot
|
# ? Feb 21, 2019 03:34 |
|
I nearly hulked out on a sales rep today. A junior dev on my team sent this sales rep an email asking about how he wanted some malformed data from an ETL process to actually look. The sales rep proceeded to hit "reply all", blast the junior dev on my team for running a lovely ETL process that loads malformed data into a new application he's trying to sell, and added add his boss, the product owner, another sales region manager, another software team's manager, and the direct manager of the junior dev in said reply. The junior dev inherited this ETL process 2 months ago from this sales rep because the contractors he had actually doing the work kept shoving malformed data into the system and then decided to not renew their contracts. The "ETL process" is really just a terrifying monolithic SQL script that lived in a shared network drive until the last contractor finally put it in source control about 4 months ago before he left.
|
# ? Feb 21, 2019 04:35 |
|
redleader posted:seems unlikely, but only because that would have to be one heck of a mega db. my guess is that they have a small number of mega dbs Its this Plus 1.5 nines of uptime
|
# ? Feb 21, 2019 04:42 |
|
Private Speech posted:I'm thinking I'll write something with SWI-Prolog for my last week at work if it's your last week, why the heck are you working overtime?
|
# ? Feb 21, 2019 05:59 |
|
ThePeavstenator posted:I nearly hulked out on a sales rep today. hulk out
|
# ? Feb 21, 2019 07:30 |
|
yes just reply all and explain how the junior dev is trying to clear up sales rep's mess if your organization does not understand that, then sever
|
# ? Feb 21, 2019 08:32 |
|
Jabor posted:if it's your last week, why the heck are you working overtime? I'm not anymore, that's a big part of why I'm leaving I won't actually do it but I'd probably get away with it
|
# ? Feb 21, 2019 09:03 |
|
I have now taken the day off work and am seriously considering writing my own lua interpreter. i think lua has given me brain damage. just say no y'all, not even once
|
# ? Feb 21, 2019 11:16 |
|
why are you doing this to yourself?
|
# ? Feb 21, 2019 11:23 |
|
Arcsech posted:it’s ok, you probably did good news: I wrote the original feature so if I did gently caress it up I can un-gently caress it and it's actually reasonably well architected and resilient to regression gently caress ups (most likely ones are creating an inconsistency between the db procedures and the models) bad news: I am the reason there are no tests on it. though I'm not the reason there are zero tests on the entire application. doing something about this is on my list once our source code and library migrations are finally done
|
# ? Feb 21, 2019 11:27 |
|
having zero tests in the entire application is always a team effort
|
# ? Feb 21, 2019 11:57 |
|
Krankenstyle posted:why are you doing this to yourself? I don’t know! it is just happening and now i am trapped in lua hell like a lobster in a pot, but without the claws or exoskeleton maybe I can trick myself into writing a scheme interpreter instead gimmicks aside, the real reason is autism
|
# ? Feb 21, 2019 12:02 |
|
make your own lua
|
# ? Feb 21, 2019 14:19 |
|
Soricidus posted:I don’t know! it is just happening and now i am trapped in lua hell like a lobster in a pot, but without the claws or exoskeleton tbf i might do similar self-damage for reasons of desperate procrastination or just plain donkeybrains
|
# ? Feb 21, 2019 14:29 |
|
Sagacity posted:yes just reply all and explain how the junior dev is trying to clear up sales rep's mess I'm sort of doing this by taking to each person. After that response I did stop what I was doing and paired with the junior dev for the rest of the day. I was able to help him prove that all the poo poo he just got blasted for has actually always been a problem and we found a few more issues that just haven't been noticed by anyone yet as well. The validation for this ETL process is just this sales guy going into the application after the data is moved and clicking around until he shrugs his shoulders and says it looks good.
|
# ? Feb 21, 2019 14:36 |
|
Soricidus posted:I don’t know! it is just happening and now i am trapped in lua hell like a lobster in a pot, but without the claws or exoskeleton just build your own language, you'll probably have more fun
|
# ? Feb 21, 2019 14:41 |
|
Soricidus posted:I have now taken the day off work and am seriously considering writing my own lua interpreter. i think lua has given me brain damage. just say no y'all, not even once rewrite luajit to support the latest poo poo, thanks in advance
|
# ? Feb 21, 2019 15:12 |
|
Chalks posted:having zero tests in the entire application is always a team effort By far the easiest way to green line your app.
|
# ? Feb 21, 2019 15:23 |
|
lol just wrote a pair of de/serializers for my custom objects, ran a big test that failed, then realized that i hadnt actually used them but still used the built-in ones
|
# ? Feb 21, 2019 17:33 |
|
Chalks posted:having zero tests in the entire application is always a team effort putting this on my annual review under the "teamwork" goal
|
# ? Feb 21, 2019 18:23 |
|
roll your own crypto.
|
# ? Feb 21, 2019 19:20 |
|
Krankenstyle posted:lol just wrote a pair of de/serializers for my custom objects, ran a big test that failed, then realized that i hadnt actually used them but still used the built-in ones turns out they worked perfectly in teh first go when i actually used them. nice.
|
# ? Feb 21, 2019 19:40 |
|
what's the least poo poo document db. there's no common data model to normalize to because the only people capable of coming up with one think that just taking the union of every property they could ever conceivably care about constitutes data modeling. i have been fighting this fight for a year, i'm giving up. so what's the least poo poo document db. e: wait i can just dump garbage into a sql server column, maybe that's the least bad option raminasi fucked around with this message at 20:19 on Feb 21, 2019 |
# ? Feb 21, 2019 20:07 |
|
|
# ? Apr 19, 2024 06:38 |
|
postgres has json and jsonb data types jsonb can be indexed
|
# ? Feb 21, 2019 20:23 |