Logs: freenode/#haskell
| 2020-09-16 20:29:03 | <hyperisco> | this is like saying oh, parametric polymorphism is just templates |
| 2020-09-16 20:29:33 | <tomsmeding> | well, c++ templates with c++20 concepts get somewhere in the right direction |
| 2020-09-16 20:29:51 | <tomsmeding> | though it's a more bloated and idiosyncratic version :) |
| 2020-09-16 20:29:55 | <lc_> | Hyperisco if you know something interfaces cant do that typeclasses can, tell me then |
| 2020-09-16 20:29:56 | <ski> | lc_ : the "object" part in your description isn't there, for type classes |
| 2020-09-16 20:29:57 | <hyperisco> | minus the whole "parametric" part |
| 2020-09-16 20:30:16 | <hyperisco> | lc_, an interface is a type, a type class is not a type, for one |
| 2020-09-16 20:30:52 | <Graypup_> | a type class can be used as a constraint but it is not a type |
| 2020-09-16 20:31:22 | <tomsmeding> | hyperisco: a Go interface is not a type |
| 2020-09-16 20:31:43 | <tomsmeding> | at least |
| 2020-09-16 20:31:46 | <hyperisco> | okay, I was referring to Java-like interfaces, and I don't know Go, but we can go on to other differences as soon as I know what a Go interface is |
| 2020-09-16 20:31:59 | <tomsmeding> | lc_: can you write a method that takes a particular type T that must be both Read and Write? |
| 2020-09-16 20:32:17 | <tomsmeding> | hyperisco: a Go interface is approximately a C++ concept :) |
| 2020-09-16 20:32:21 | <Graypup_> | a go interface (as a non go programmer so boulder of salt etc) is a set of methods that you are saying a type has, and you accept things that have it |
| 2020-09-16 20:32:28 | <Graypup_> | which is, yeah, ≈ a C++ concept |
| 2020-09-16 20:32:53 | <lc_> | You can make that interface. But that reminds me of a constraint for interfaces, where you can't really "combine them", e.g. you cant say input to function f must satisfy x y and z interfaces |
| 2020-09-16 20:33:01 | <tomsmeding> | ah |
| 2020-09-16 20:33:08 | <hyperisco> | last I grazed C++, concepts were just a figment of C++14's imagination |
| 2020-09-16 20:33:16 | <lc_> | So that's a genuine constraint, and people make specialty interfaces to get around that. But they're kinda similar |
| 2020-09-16 20:33:17 | <Graypup_> | they exist as of C++20 |
| 2020-09-16 20:33:19 | <tomsmeding> | whereas in haskell, I can write a function: foo :: (Read a, Write a) => a -> Something |
| 2020-09-16 20:33:24 | <lc_> | Exactly |
| 2020-09-16 20:33:30 | <lc_> | We have to have a ReadWriter for that |
| 2020-09-16 20:33:34 | <hyperisco> | well congratulations to them |
| 2020-09-16 20:33:48 | <hyperisco> | the end of error novels? |
| 2020-09-16 20:33:59 | <tomsmeding> | hyperisco: it's c++ |
| 2020-09-16 20:34:03 | <Graypup_> | lmao |
| 2020-09-16 20:34:12 | <Graypup_> | haskell also has error novels |
| 2020-09-16 20:34:14 | <hyperisco> | alright so that hype was overhype |
| 2020-09-16 20:34:15 | <Graypup_> | IME |
| 2020-09-16 20:34:24 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-16 20:34:25 | <tomsmeding> | though I've had haskell errors that don't fit on a screen too |
| 2020-09-16 20:34:28 | <ski> | tomsmeding : or `read :: Read a => String -> a' |
| 2020-09-16 20:34:37 | <Graypup_> | haskell errors are crap compared to rust errors |
| 2020-09-16 20:34:51 | → | borne joins (~fritjof@200116b864b6860060095f4622ae75c8.dip.versatel-1u1.de) |
| 2020-09-16 20:35:01 | <rustisafungus> | Graypup_: yeah i think many in the haskell community recognize that it would be worthwhile investing in developer ergonomics |
| 2020-09-16 20:35:09 | <tomsmeding> | ski: or is that really a feature of parametric polymorphism? |
| 2020-09-16 20:35:14 | <hyperisco> | okay but "error novel" is like, I hope your terminal has a large enough buffer for this |
| 2020-09-16 20:35:15 | <lc_> | I retract my statement about them being exactly the same thing. They are exactly the same thing conditional on being able to assert multiple interfaces per variable. But it is correct to call them "interfaces" |
| 2020-09-16 20:35:21 | <maerwald> | Graypup_: not so fast |
| 2020-09-16 20:35:21 | <tomsmeding> | you can't write 'read' in Go I think |
| 2020-09-16 20:35:33 | <maerwald> | borrow checker errors can be quite confusing too |
| 2020-09-16 20:35:42 | <ski> | tomsmeding : type classes depend on parametric polymorphism |
| 2020-09-16 20:36:07 | <Graypup_> | that's true but they're doing their best. haskell has too fancy of types to have good errors I suspect |
| 2020-09-16 20:36:32 | <ski> | lc_ : how would you call the method of an interface, if there's no object to call it on ? |
| 2020-09-16 20:36:47 | <hyperisco> | lc_, if "interface" is meant loosely then I don't disagree. It is just a common tripping point when someone believes type classes = OOP interfaces, or other notions of "interface" |
| 2020-09-16 20:37:06 | <dolio> | For some reason, people complain about GHC's errors, and the response seems to be to put ever more information in them. :) |
| 2020-09-16 20:37:11 | <maerwald> | Graypup_: you don't have to use that jazz |
| 2020-09-16 20:37:18 | <tomsmeding> | lc_: with ski's help, I think indeed the Read type class is a good example of something that doesn't map well to Go |
| 2020-09-16 20:37:24 | <Graypup_> | maerwald, yesod go brrr |
| 2020-09-16 20:37:32 | <dolio> | Even though it seems like the opposite would be better. |
| 2020-09-16 20:37:44 | → | aenesidemus_ joins (~aenesidem@c-73-53-247-25.hsd1.fl.comcast.net) |
| 2020-09-16 20:37:56 | <maerwald> | Graypup_: that's exactly why I don't use it |
| 2020-09-16 20:38:11 | <hyperisco> | GHC would have great errors probably if everyone stopped using so much inference |
| 2020-09-16 20:38:46 | <dolio> | I don't know about that. |
| 2020-09-16 20:38:50 | <Graypup_> | maerwald, well I didn't choose to get hired working on a yesod project, and honestly didn't have much of a choice anyway haha |
| 2020-09-16 20:39:02 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 260 seconds) |
| 2020-09-16 20:39:02 | × | pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 260 seconds) |
| 2020-09-16 20:39:15 | <maerwald> | yeah, you might as well go back to Java |
| 2020-09-16 20:39:27 | <lc_> | Anyone here got any thoughts about using golang vs. Haskell in a production environment. I come close to switching a lot, but I really don't like meme chasing |
| 2020-09-16 20:39:31 | <tomsmeding> | maerwald: that escalated quickly |
| 2020-09-16 20:39:32 | <Graypup_> | java has better errors and doesn't require a PhD to understand the type theory |
| 2020-09-16 20:39:38 | <hyperisco> | tomsmeding, looks like an interface is a type in Go |
| 2020-09-16 20:39:41 | <Graypup_> | oops a controversial statement |
| 2020-09-16 20:39:49 | <maerwald> | tomsmeding: that was sarcasm towards yesod |
| 2020-09-16 20:39:52 | <dolio> | I don't have a PhD. |
| 2020-09-16 20:40:12 | <dolio> | Neither does SPJ, I think. |
| 2020-09-16 20:40:16 | <sm[m]> | new-to-you ghc errors can suck, but ghc errors you see repeatedly in production code soon become a non-problem |
| 2020-09-16 20:40:18 | <hyperisco> | you can mail my honorary PhD to my PO box |
| 2020-09-16 20:40:35 | <tomsmeding> | Graypup_: true, but there's metric tonnes of stuff you can do in haskell that you can't in java :p |
| 2020-09-16 20:40:38 | <tomsmeding> | in terms of abstractions |
| 2020-09-16 20:41:11 | <maerwald> | lc_: if you like to live in microservice hell, Go is your first choice |
| 2020-09-16 20:41:29 | <hyperisco> | lc_, imo that depends on the project. If Go has the right libraries and ecosystem already for the job then have at it |
| 2020-09-16 20:41:32 | <tomsmeding> | dolio: SPJ has a honorary doctorate |
| 2020-09-16 20:41:39 | <dolio> | Ah, okay. |
| 2020-09-16 20:41:50 | × | aenesidemus quits (~aenesidem@c-73-53-247-25.hsd1.fl.comcast.net) (Ping timeout: 260 seconds) |
| 2020-09-16 20:42:06 | → | aenesidemus joins (~aenesidem@c-73-53-247-25.hsd1.fl.comcast.net) |
| 2020-09-16 20:42:14 | → | pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net) |
| 2020-09-16 20:42:16 | <Graypup_> | tomsmeding, well I literally work on a webapp that has a logic checker embedded in it so... |
| 2020-09-16 20:42:18 | × | aenesidemus_ quits (~aenesidem@c-73-53-247-25.hsd1.fl.comcast.net) (Ping timeout: 260 seconds) |
| 2020-09-16 20:42:24 | <Graypup_> | yeah java is a no go |
| 2020-09-16 20:42:25 | <rustisafungus> | it would be nice if there was a way to do away with the "libraries" entrechment phenomenon to promote language innovation |
| 2020-09-16 20:42:51 | <lc_> | maerwald: Completely incorrect. I work on a golang project that is almost entirely a monolith besides its dependencies on NIH apis and infra |
| 2020-09-16 20:43:09 | <monochrom> | Graypup_, I think your experience about advanced types is due to using some of the web frameworks that go crazy with advanced types, and is not representative of what other people experience, certainly not what I experience. |
| 2020-09-16 20:43:10 | <lc_> | why anyone would suggest that golang --> microservices beyond the fact that its easy to use the http libraries is beyond me |
| 2020-09-16 20:43:15 | <maerwald> | lc_: how does that make my statement incorrect |
| 2020-09-16 20:43:21 | <tomsmeding> | lc_: maerwald said microservices -> go, but go -> microservices |
| 2020-09-16 20:43:23 | <maerwald> | I didn't talk about your work project :) |
| 2020-09-16 20:43:23 | <tomsmeding> | ;) |
| 2020-09-16 20:43:30 | <tomsmeding> | s/but/not/ |
| 2020-09-16 20:43:45 | <lc_> | you got me there |
| 2020-09-16 20:44:00 | <monochrom> | But I don't speak badly of Java either because Java has a better exception system. |
| 2020-09-16 20:44:08 | <maerwald> | indeed |
| 2020-09-16 20:44:17 | <maerwald> | But I still speak badly of it :) |
| 2020-09-16 20:44:26 | <dolio> | Yeah, I don't really have many problems with weird type errors. I mainly don't find the list of information about everything in scope in a where clause very useful, and such like. |
| 2020-09-16 20:44:27 | <hyperisco> | I read recently how the exception system is terrible in Java and how Haskell does it better, lol |
| 2020-09-16 20:44:46 | <monochrom> | We can all speak badly about a bad aspect, as opposed to a whole language. |
| 2020-09-16 20:44:49 | <hyperisco> | my experience with checked exceptions is checkered |
| 2020-09-16 20:44:53 | <maerwald> | hyperisco: haskell has an exception system? |
| 2020-09-16 20:45:04 | <hyperisco> | as a library sure |
All times are in UTC.