|
Notorious b.s.d. posted:iostreams has a lot of problems but the builder pattern isn't the root of them I too like text output systems that cannot be localized.
|
# ? Feb 9, 2014 01:36 |
|
|
# ? Jun 6, 2024 12:33 |
|
pseudorandom name posted:I too like text output systems that cannot be localized. there are plenty of ways to build a printf replacement that doesn't involve a second little macro language, unchecked by your compiler, inside string literals but yeah a builder with inline strings has the notable downside of not easily changing the location of substitutions
|
# ? Feb 9, 2014 01:38 |
|
Notorious b.s.d. posted:let me turn this around for you. Since I've never really written a line of Haskell here, is that how those operators are usually used? I thought this was more of a domain-specific thing where you have: x = (y #%%~ z)
|
# ? Feb 9, 2014 01:44 |
|
i mean idk since i dont use haskell at all, but maybe that's not so bad? at least the goofy operators are compositions of regular haskell operators, right? it seems like if you were comfortable with the regular syntax of haskell then you could piece together what the operators meant. this is actually why long names are good, you piece together the meanings of the whole from each individual word. often times you are trading inscrutable operators with jargon. the same with the loop macro or whatever. you derive the meaning from experience and context just like with anything else. once again, maybe not totally applicable, but compare it to the math analogy. if you blew up all of your variables to long names you would have pretty much incomprehensible and unfixable garbage for any but the most basic of problems. brevity can improve readability. it isn't a one way street.
|
# ? Feb 9, 2014 01:44 |
|
Notorious b.s.d. posted:there are plenty of ways to build a printf replacement that doesn't involve a second little macro language, unchecked by your compiler, inside string literals Just curious, do you have any ideas for a localizable printf replacement?
|
# ? Feb 9, 2014 01:45 |
|
Suspicious Dish posted:Since I've never really written a line of Haskell here, is that how those operators are usually used? AlsoD posted:let's look at some real code, some of the worst examples from my game (well i call it that, it's barely at the stage where it's interactive)
|
# ? Feb 9, 2014 01:48 |
|
It seems I missed that post before. Thanks for the quote, and thanks for explaining! I understand better now.
|
# ? Feb 9, 2014 01:49 |
|
Suspicious Dish posted:Just curious, do you have any ideas for a localizable printf replacement? idk design is not my strong suit. maybe something with placeholders ala printf, but no type impositions? all arguments must be a string, with processing finished before being passed on. there has got to be a better way to do this, to enable more checking by the compiler (e.g. number of placeholders)
|
# ? Feb 9, 2014 01:49 |
|
bad operator usage is for instance the example of the minus sign with strings, god drat thats loving dumb. without an example you have no idea what it means and the actual subtractions could potentially give you errors, gross. if you're going to use math operators you better be sure it actually works like math.
|
# ? Feb 9, 2014 01:49 |
|
funroll loops posted:i mean idk since i dont use haskell at all, but maybe that's not so bad? at least the goofy operators are compositions of regular haskell operators, right? it seems like if you were comfortable with the regular syntax of haskell then you could piece together what the operators meant. this is actually why long names are good, you piece together the meanings of the whole from each individual word. often times you are trading inscrutable operators with jargon. the same with the loop macro or whatever. you derive the meaning from experience and context just like with anything else. Notorious b.s.d. posted:so because the rest of haskell is loving terrible, the abortions in the lens library are supposed to get a free pass?
|
# ? Feb 9, 2014 01:50 |
|
coffeetable posted:mathematical ideas are best communicated with prose. the notation's just there to a) provide rigour where plain english can't and b) so the reader doesn't have to invent their own notation when they themselves want to manipulate the ideas at hand. this is entirely true but it's far more efficient to have symbols. it has diminishing returns so poo poo like "=" is a-ok but im doubtful that %%@= is actually useful to anyone
|
# ? Feb 9, 2014 01:51 |
|
Notorious b.s.d. posted:there are plenty of ways to build a printf replacement that doesn't involve a second little macro language, unchecked by your compiler, inside string literals dependent types now!!!!
|
# ? Feb 9, 2014 01:52 |
haskell is useless
|
|
# ? Feb 9, 2014 01:54 |
|
bsd stymie strikes again! show me on this code where the bad language touched you meanwhile, the cool kids will be riding through the fields on the horse of true mathematics
|
# ? Feb 9, 2014 01:55 |
|
double sulk posted:haskell is useless
|
# ? Feb 9, 2014 01:55 |
|
double sulk posted:haskell is useless
|
# ? Feb 9, 2014 01:56 |
|
double sulk posted:haskell is useless dont sign you are posts!!!!!
|
# ? Feb 9, 2014 01:56 |
|
i mean if you are too stupid to take a tiny bit of time to understand what operators that work consistently mean then idk what to tell you. it isn't always a bad idea to collapse extremely commonly used and generic things into smaller symbols because the brevity can make things clearer. see: math
|
# ? Feb 9, 2014 01:56 |
|
simon peyton jones said it himself https://www.youtube.com/watch?v=iSmkqocn0oQ
|
# ? Feb 9, 2014 01:57 |
|
Notorious b.s.d. posted:a second little macro language, unchecked by your compiler maybe you should get a better compiler
|
# ? Feb 9, 2014 01:57 |
|
why are so many people unable to distinguish 'operator overloading' from 'defining your own infix operators'
|
# ? Feb 9, 2014 01:59 |
|
vOv posted:why are so many people unable to distinguish 'operator overloading' from 'defining your own infix operators' (vOv)
|
# ? Feb 9, 2014 02:00 |
|
vOv posted:why are so many people unable to distinguish 'operator overloading' from 'defining your own infix operators' the intent is nearly the same, you just carry less baggage when you don't use the regular math ones
|
# ? Feb 9, 2014 02:02 |
|
funroll loops posted:the intent is nearly the same, you just carry less baggage when you don't use the regular math ones the baggage is good though. if i overload (+) on my vector type, it is patently obvious to anyone reading what (u + v) is computing. conversely, the first seventeen times they encounter (u #!% v) they're going to have to toddle off to the documentation
|
# ? Feb 9, 2014 02:06 |
|
ofc, if you can labour under the assumption that anyone reading your code is already familiar with (#!%) and its effect on vectors, then it's absolutely fine to use (#!%). if lenses became ubiquitous throughout the programming world, it'd be fine to use them because as alsod says, there is a method in their madness and it doesn't take long to learn how to deduce what they do. but very few people are familiar with lenses and that's not changing any time soon so~
|
# ? Feb 9, 2014 02:08 |
|
coffeetable posted:the baggage is good though. if i overload (+) on my vector type, it is patently obvious to anyone reading what (u + v) is computing. conversely, the first seventeen times they encounter (u #!% v) they're going to have to toddle off to the documentation Oh, and what does the overloaded (*) do on your vector type?
|
# ? Feb 9, 2014 02:09 |
|
the lens operators ain't great but they're pretty much required knowledge to get a job in software these days
|
# ? Feb 9, 2014 02:11 |
|
Deus Rex posted:Oh, and what does the overloaded (*) do on your vector type? double*vector, fine vector*double, fine vector.vector, fine (guessing this is what you were saying)
|
# ? Feb 9, 2014 02:11 |
|
Deus Rex posted:Oh, and what does the overloaded (*) do on your vector type? crossproduct b/c i make my vectors an applicative functor so i can use element wise poo poo but only for 3d vectors (and 7d but lmao) and my inner product is *. and my outer product is (,)
|
# ? Feb 9, 2014 02:13 |
|
coffeetable posted:the baggage is good though. if i overload (+) on my vector type, it is patently obvious to anyone reading what (u + v) is computing. conversely, the first seventeen times they encounter (u #!% v) they're going to have to toddle off to the documentation it's only good when used in that way, rather than retards overloading the - operator on strings or whatever. quote:ofc, if you can labour under the assumption that anyone reading your code is already familiar with (#!%) and its effect on vectors, then it's absolutely fine to use (#!%). if lenses became ubiquitous throughout the programming world, it'd be fine to use them because as alsod says, there is a method in their madness and it doesn't take long to learn how to deduce what they do. like i said before i dont really know haskell but doesn't lenses just let you combo a bunch of poo poo together that is usually there to begin with? even if not it doesn't seem like it would take a gargantuan amount of effort to understand what each operator does and then how they get linked together. context etc. i mean you can just go and use the most popular things, thats fine, but sometimes you might miss out on better alternatives. it's basically shaggaring to say that the most popular is the objective best because its the most popular.
|
# ? Feb 9, 2014 02:23 |
|
motedek posted:the lens operators ain't great but they're pretty much required knowledge to get a job in software these days i always want to hear from people doing haskell work that is not for a bank and not an otherwise one off project within a company
|
# ? Feb 9, 2014 02:29 |
|
and on the topic of punctuation let's talk about list comprehensions haskell: [(x+y)^2 | x <- [0..10], y <- [0..10], even x, odd y] python: [pow (x+y,2) for x in range(0,11) for y in range (0,11) if x&2 if not (y&2)] i know which one i prefer. what does it look like in c#/linq btw? gonadic io fucked around with this message at 02:36 on Feb 9, 2014 |
# ? Feb 9, 2014 02:29 |
|
im p sure its like from x in Listwhatever from y in OtherListWhatever select (x+y)^2 where x%2 where !(y%2)
|
# ? Feb 9, 2014 02:35 |
|
never used c# tho
|
# ? Feb 9, 2014 02:35 |
|
AlsoD posted:and on the topic of punctuation let's talk about list comprehensions iirc, either from x in Enumerable.Range(0, 10) from y in Enumerable.Range(0, 10) where x%2 == 0 where y%2 == 1 select Math.Pow(x+y, 2) or from x in Enumerable.Range(0, 10) join y in Enumerable.Range(0, 10) on x%2 not equals y%2 select Math.Pow(x+y, 2) or Enumerable.Range(0, 10).Join(Enumerable.Range(0, 10), x => x%2 - 0, y => y%2 + 1, (x, y) => Math.Pow(x+y, 2)) personally id go w/ the first, but with helper functions for even, odd and square. the fact C# doesn't have an integer power operator still irks me coffeetable fucked around with this message at 02:41 on Feb 9, 2014 |
# ? Feb 9, 2014 02:38 |
|
Deus Rex posted:Oh, and what does the overloaded (*) do on your vector type? nothing, because you've overloaded ⨯ and ∙ instead
|
# ? Feb 9, 2014 02:49 |
|
pseudorandom name posted:nothing, because you've overloaded ⨯ and ∙ instead oh god I wish I had (∘) instead of (.) in haskell. we've had the unicode sytax discussion before though
|
# ? Feb 9, 2014 02:59 |
|
AlsoD posted:oh god I wish I had (∘) instead of (.) in haskell. we've had the unicode sytax discussion before though oh, but you can http://hackage.haskell.org/package/base-unicode-symbols-0.2.2.4/docs/Prelude-Unicode.html
|
# ? Feb 9, 2014 03:15 |
|
AlsoD posted:we've had the unicode sytax discussion before though it's more of a "recognise it's probably a bad idea" thing e: poo poo imagine how fun lens would be with unicode operators or classy-prelude or just being able to use ⅓ and such gonadic io fucked around with this message at 03:22 on Feb 9, 2014 |
# ? Feb 9, 2014 03:16 |
|
|
# ? Jun 6, 2024 12:33 |
|
Can we talk for a second about editor-agnostic "IDE" tooling, by which I mean packages like ENSIME, nREPL, TSS or Eclim that analyze your source and provide a channel for communicating autocompletion, type information, on-the-fly evaluation, searching, validation and other IDE niceties with the editor of your choice. Why did it take until pretty recently (the Eclim project started in 2005) for this kind of separation of editor + IDE features to come around? Why was/is everyone re-inventing these wheels for every which Emacs/Vim/Sublime Text/loving whatever?
|
# ? Feb 9, 2014 03:25 |