« first day (1036 days earlier)      last day (3927 days later) » 

7:00 PM
It isn’t just sugar.
 
user1804599
INCONSISTENCY
 
@CatPlusPlus yeah.
 
user1804599
@CatPlusPlus error in Gear. :>
 
TIL boost::regex_replace not overlapping memory safe
Also TIL regular expressions fucking suck
 
user1804599
Pattern matching failure. vOv
 
7:00 PM
[1,,,,5] → [1, undefined × 3, 5]
 
@not-rightfold should produce partially applied function <3
 
user1804599
Well unless the function isn't defined in Gear. :P
 
well, I think JS is even more terrible than C++, and that's an achievement
 
Nah, they’re on different scales of terrible.
 
user1804599
JavaScript is way better than C++.
 
7:01 PM
that's what I said.
 
It’s like comparing apples to oranges.
 
@A.H. 300,000 Vim users can't be wrong haven't caught on yet.
 
well JS is better than say, Ruby or PHP
 
Oranges are super delicious and great
 
user1804599
Holy shit.
 
7:01 PM
And apples suck
 
@minitech except no it's not
 
function f() { this /* take a guess what this is */ }
 
user1804599
I need to add floating point literals to Gear too.
 
user1804599
@BartekBanachewicz lolphp
 
@CatPlusPlus well dunno it should be a member function?
 
7:02 PM
@BartekBanachewicz It is. Oranges are super delicious and great, and apples are horrible things that make me sick.
 
user1804599
this is fun in callbacks.
 
Except when used in pies.
 
The correct answer is "anything".
 
@minitech People are trying to make other things than web in JS. And that's fucking not how it's supposed to work
 
@not-rightfold Arrow functions FTW
 
7:02 PM
Because it depends on how you call the damn thing.
And where you call it.
 
@CatPlusPlus Also, who cares
 
@CatPlusPlus oh amazing
 
@BartekBanachewicz Alexander Pope would be so proud of you.
 
user1804599
JavaScript is bad and you should feel bad.
 
@BartekBanachewicz Wait, it was supposed to work?
@not-rightfold The world needs more CoffeeScript
 
user1804599
7:03 PM
Uh no.
 
user1804599
The world needs more Haskell.
 
@minitech js is a fucking terrible creation that's been lobbyed into web browsers
 
user1804599
I should install Fay.
 
And you better not forget var ever.
 
yeah enough of its idiocies already
 
7:04 PM
@CatPlusPlus You better 'use strict';
@BartekBanachewicz *its
 
I decided to get to know how <random> works, and I figured, now I can redesign my usual random generator, because I don't have the global rand/srand. For trivial things (no security issues or similar, say games), what engine should I use?
 
@not-rightfold Ew, functional programming?
 
user1804599
Arrrrr can't wait till my book gets delivered.
 
@Pawnguy7 std::default_random_engine
 
user1804599
> Ew
 
7:04 PM
@minitech AKA Programming
 
user1804599
Get out.
 
Why would I want math in my computer instructions
 
JS fags cannot into FP
 
user1804599
Use Gear!
 
user1804599
@minitech Because math is proven and it works.
 
7:05 PM
Don't 4chan tia.
 
@minitech because you can write code that actually works that way
and it's not like "works on some data sometimes"
 
… I think I should leave.
 
@minitech better use asm and use LLVM to code in a proper language
 
@minitech noooo!
 
user1804599
7:06 PM
@minitech noooo!
 
it's no fun without you
 
Oh, all right you guys! <3
 
user1804599
Just learn a functional language!
 
yeah, you should learn haskell
 
Okay. I am seriously going to be serious for a second.
 
7:06 PM
Even a functioning one would be a good start.
 
it opens eyes
@CatPlusPlus :D
 
Can somebody explain to me the point of a purely functional language?
See, I agree that Haskell’s type system is the best.
And it creates some really great ways to do things.
 
user1804599
@CatPlusPlus Hmm looks neat.
 
Strong guarantees, easy parallelisation.
 
7:07 PM
@minitech it's very easy to debug and unit test. you can mathematically prove correctness of the program. and parallelism
 
user1804599
GeneralizedNewtypeDeriving is also one of my favourite extensions.
 
More room for machine optimisation.
 
@BartekBanachewicz So can I just have pure sections in some language?
 
@minitech yeah, sure. A mathematical sin function is a nice example.
 
user1804599
@minitech D has a pure keyword which guarantees purity (or weak purity in some cases; useful in imperative settings).
 
7:08 PM
You need impure glue to the world, but most stuff in your program could probably easily be pure.
 
@not-rightfold I was going to mention D
 
Wow simonpj is an active developer.
 
@minitech anyway in imperative language it's going to be much less elegant.
 
@CatPlusPlus Pretty much that.
 
but in general FP principles lead to rather good imperative code
 
7:09 PM
I want functional a lot, but not always.
 
Haskell is still better imperative language than most imperative languages. :v
 
also that.
@minitech do notation. You want not-functional only when dealing with IO pretty much
 
user1804599
@minitech You can do imperative programming in Haskell.
 
@not-rightfold Do people hate you for it, though?
 
user1804599
@minitech Depends.
 
7:10 PM
you can't do non-imperative IO
or rather, you can't do pure IO
 
user1804599
Some things are more clearly expressed imperatively.
 
user1804599
But the nice thing is that you still get purity guarantees and a strong type system.
 
23
Q: Why is Haskell (sometimes) referred to as "Best Imperative Language"?

hvr(I hope this question is on-topic -- I tried searching for an answer but didn't find a definitive answer. If this happens to be off-topic or already answered, please moderate/remove it.) I remember having heard/read the half-joking comment about Haskell being the best imperative language a few t...

 
@CatPlusPlus Monads <3
 
And I love the idea of Haskell. However, it makes people write things that look totally obscure. Any alternatives with actual words?
 
Oh, right, Lisp
 
@minitech haskell is way more readable than lisp
 
user1804599
@CatPlusPlus lol
 
after a week I don't consider it obscure at all
 
@BartekBanachewicz I strongly disagree with that, but maybe I need to study Haskell for another twenty years
 
7:11 PM
Wut.
 
@minitech uh, and how long have you been learning haskell?
 
Lisp has really heavy syntax overhead.
 
@CatPlusPlus I like “explicit”
 
user1804599
@minitech Elixir is quite neat if you don't care about impurity and dynamic typing. And a community consisting of only me and four other people.
 
@minitech I was doing this as a total beginner
 
user1804599
7:12 PM
But I suggest Haskell as a first functional language.
 
Parentheses aren't "explicit", they're superfluous.
I'd suggest Haskell as a first language ever.
 
@minitech it pretty much equals to "unreadable", and TBH also "unwriteable"
yay for Lisp macros so readable.
 
No need to train more filthy low-level imperative savages.
 
rndSelect' n xs g = ((at i) : ys, g'')
    where at = elementAt xs
          (i, g') = randomR (1, length xs) g
          (ys, g'') = rndSelect' (n-1) xs g'
^ This isn’t even mostly words
 
user1804599
Mine was better. :x
 
7:13 PM
It’s funny because everybody else here totally understands it
 
@minitech that's actually one of the hardest ones. And that's not a very good solution either
 
user1804599
@minitech What don't you understand about it?
 
@BartekBanachewicz What does it do?
 
@minitech btw g'' is an identifier as g2
 
user1804599
(Hint: (…, …) is a two-tuple and : is cons.)
 
7:14 PM
car and cdr are much more readable.
 
@minitech rndSelect' :: (RandomGen g) => Int -> [a] -> g -> ([a], g) Don't copy haskell functions without a type signature
takes an int, an array and a random generator, and returns a tuple of n random elements from that array and a generator again
 
user1804599
I'm going to add ?, ! and ' to Gear soon.
 
@not-rightfold Gear?
 
@minitech his language
 
user1804599
A horrible language that is still better than JavaScript.
 
7:15 PM
Visible somewhere?
 
user1804599
 
user1804599
The web page lacks demonstration of some features I added later, though.
 
@not-rightfold meh, your array comprehensions are lenghty
 
user1804599
@BartekBanachewicz I was lazy.
 
7:17 PM
@not-rightfold suckage.
 
Oh, and then there’s the matter of recursion in FP.
 
[x | x <- [1,2,3], isEven x] or gtfo
 
user1804599
let isEven = fn x {
    match x % 2 {
        0 { true }
        1 { false }
    }
} in
 
@minitech what about it?
 
Apparently super-great and everybody loves it, but it is the exact opposite of how I think about things
 
user1804599
7:18 PM
LOL.
 
user1804599
I didn't have == back then.
 
@minitech there's the real problem. You have to change the way you look at things to write proper FP code.
and IMHO the change is good.
 
@BartekBanachewicz And I really don’t see a reason to do that
Given that I can be as functional as I like in any half-decent imperative language
And use actual words and read things left-to-right, top-to-bottom
 
user1804599
If you don't like recursion just write an abstraction.
 
@minitech to make it real you have to push it past the boundaries
you are comfortably living with a small subset of FP
but that's not, heck no, not what FP really is
 
7:20 PM
@BartekBanachewicz holy triple negative batman
 
The current reason for learning FP is so that you can think in FP, no?
 
@minitech that's because you are used to that style. It doesn't mean it's the best way.
 
user1804599
So that you can improve yourself.
 
@minitech And solve problems more efficiently with that thinking
 
user1804599
Learn more languages and paradigms.
 
7:21 PM
because there are problems that are trivial and elegantly solvable with FP, but totally asshat in imperative
and vice versa, of course
 
I haven’t even learned COBOL yet, and people invent paradigms all the time.
 
FP is older than IP
FYI.
 
Great, does it matter?
 
No
 
user1804599
7:22 PM
COBOL is horrible.
 
I know COBOL is horrible.
 
what matters is that the fact that imperative programming and JS are popular now, doesn't mean much in terms of how good or bad they are in solving some problems compared to FP languages
 
user1804599
It starts with the screaming name.
 
@BartekBanachewicz Which problems?
 
man.
 
7:23 PM
I just don’t have compelling evidence at all yet
 
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
    where
        lesser  = filter (< p) xs
        greater = filter (>= p) xs
@minitech write that in JS ^
 
First off, you’re making me write it in a sucky language
 
or in any other imperative language
 
That’s not fair
 
any imperative language and in imperative style
 
7:24 PM
I’m going to write it in an imaginary good language
 
user1804599
Instead of all this moaning about the essence of functional programming you could've been learning a functional language and have both an answer to your question and you've learned a new language and paradigm.
 
no, existing real world language
 
@BartekBanachewicz Really?
 
also I agree with righfold
@JerryCoffin except task lists :F and stuff like prescriptions in alchemy. But come on.
 
@BartekBanachewicz Seems like a bit of a stretch, to put it mildly.
 
7:25 PM
Fine, I’ll write it in JavaScript
 
@minitech don't forget to test all edge cases
 
Why is it that you cannot do 0f, but rather must do 0.f?
 
also before you even start your solution is slower.
 
user1804599
@Pawnguy7 because.
 
@Pawnguy7 because C
 
7:26 PM
@BartekBanachewicz lol you've finally become one of those people who get smug over FP.
 
@Rapptz finally? I thought it was long ago
 
You even used the quicksort example everyone and their mother fucking throws around
 
@Rapptz Didn't take long
 
user1804599
Why don't you just learn a functional language?
 
user1804599
There is no downside to it.
 
7:27 PM
@Rapptz because it's a good example? I know it's being thrown around, it's mentioned everywhere it appears
 
user1804599
Mathematicians don't understand why imperative programmers rebind variables either. vOv
 
@BartekBanachewicz Because it's an awful example.
 
function quicksort(arr) {
    var pivot = arr[0]; // XXX: Horrible
    var lesser = arr.filter(x => x < pivot);
    var greater = arr.slice(1).filter(x => x >= pivot);
    return lesser.concat([pivot]).concat(greater);
}
 
It doesn't really show anything, I don't think it ever did
 
7:27 PM
@minitech that's not imperative.
 
@BartekBanachewicz It’s an imperative language
I think you misunderstand my argument
 
user1804599
@BartekBanachewicz Wouldn't look that different in JavaScript.
 
@minitech b-b-b-but muh paradigms!
 
user1804599
Probably very much the same with parentheses on different places and some other operator than ++, and the where clause in a different place.
 
@minitech I thought we were talking about functional programing
 
7:28 PM
I wish this FP superiority complex would die
 
Yes, exactly. Very much the same.
It’s functional programming in an imperative language
Because functional programming is good at this type of problem
But I can still use it if I want to
 
@minitech // XXX: Horrible goes with the quicksort territory.
 
And people do
So why should I bother learning a language that I find a lot harder to read, since its reading order is not necessarily consistent?
 
@minitech exactly. So if you are using more functional programming then imperative programming, use functional language :O
@minitech it's more consistent that JS will ever be
 
Convincing.
 
7:30 PM
@BartekBanachewicz I am not saying JS is great
 
eh, enough
 
It’s bad, we all agree
 
@minitech I am saying either learn it or not.
 
@minitech The spaniards ask themselves that question a lot.
 
So isn’t that an argument to make an imperative any language that’s actually decent?
 
7:30 PM
after you learn it we can talk about it
because you're like "it's not the syntax I know why should I learn it"
 
@minitech Please make a decent language. Then we can criticize you for it.
 
@minitech Mostly to force yourself to think in a functional style (at least for a while) to learn to apply that style to a greater variety of problems.
 
@JerryCoffin See, that’s a good reason.
 
@minitech we told you that a few times already
 
user1804599
@minitech Because it won't be hard to read once you have read an introductory tutorial.
 
7:32 PM
@not-rightfold I have, it’s still hard. Weird
 
user1804599
You couldn't read your first imperative language either when you were first exposed to it for only two minutes.
 
@minitech Yeah, you're right.
 
That’s the thing
I could
 
A basic tutorial in Haskell won't really teach you all the syntax
 
user1804599
If you don't explore new things you won't get better.
 
7:32 PM
It was BASIC, and I was like “hey, this is English” and bam
Haskell? Symbols! I don’t know which order to read them in!
 
@minitech All I saw was 0AF, BBFF, 33E0
 
@minitech maybe try writing then
 
I like Haskell when people use readable names
@BartekBanachewicz I have
 
@minitech well then learn what they do :v
 
@BartekBanachewicz Trying.
 
7:34 PM
stuff like (f . g . h) a is very intuitive once you understand it
and you can try doing the H99 too
 
user1804599
h >> g >> f :>
 
If you learn Haskell go with real world haskell
learn you a haskell sucks
 
@Rapptz I enjoyed it
 
I think it spawns FP superiority demons or something
 
LYAH is bit simpler.
 
user1804599
7:35 PM
LYAH is great.
 
the drawings are great
 
Anyways, to try and figure out what I was originally trying to say: Is FP better or is it just different?
 
@Rapptz floating point is a bad bad thing. WHAT ABOUT PI!
 
user1804599
It's written in a great way.
 
user1804599
It's unboring.
 
7:35 PM
@minitech better implies stating a problem
 
Signs point to “different” and I am trying to learn it for the sake of learning it. Very boring, though.
 
I think I read it up till ranges, and for some reason never revisited it. Or maybe it was the function part.
 
@minitech I was totally sucked in for a week
couldn't stop reading
 
@minitech Speaking objectively there are a couple of things in a pure functional language that make it better for a sense of the word. (See: implicit conversions, etc)
 
yeah well Haskell's type system is awesum
 
7:36 PM
Yes. Haskell’s typing is super.
 
@minitech What do you think about the mondern constructs like lambdas, events and delegates?
 
except non-generic old functions :/
 
@CaptainGiraffe They’re great.
 
user1804599
 
lambdas are the essence of FP
 
7:37 PM
Events?
 
user1804599
This is how LYAH makes you feel.
 
I think I will write my collision engine in Haskell
 
Hey, I want to say something but I’m not sure what it is yet. So: how would you write fibonacci in Haskell?
 
user1804599
@BartekBanachewicz Using FFI?
 
@Pawnguy7 Yes, imo events and delegates are as close as sugar. Lambdas are not but the feel is there.
 
user1804599
7:39 PM
@minitech What does it do?
 
user1804599
fibonacci :: Int -> Int or fibonacci :: [Int]?
 
@not-rightfold fibonacci :: Int -> Int
 
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
 
user1804599
 
I think it should work
 
7:39 PM
@BartekBanachewicz Cool. Is it efficient?
 
@minitech Yes
 
Does the compiler optimize this?
 
@minitech well dunno. that's a whole another question. But GHC does wonders when optimizing
 
Do I know? Does it always?
I hate not controlling that
 
lol and you write in JS
ahahaah
so much suckage.
 
7:40 PM
@minitech Don't think so.
 
@minitech Then you want c or maybe c++.
 
user1804599
@BartekBanachewicz Use par!
 
@CaptainGiraffe Yes. Or pretty much anything else
 
Speaking of that random select.
pick :: (MonadState s m, RandomGen s) => [a] -> m a
pick xs = do
    idx <- state $ randomR (1, length xs - 1)
    return $ xs !! idx

pickN :: (MonadState s m, RandomGen s) => Int -> [a] -> m [a]
pickN n xs = replicateM n $ pick xs

solution :: (RandomGen g) => Int -> [a] -> g -> ([a], g)
solution n xs = runState $ pickN n xs
 
@minitech No mostly C or C++. Fortran will work too.
 
7:41 PM
@CaptainGiraffe No, pretty much anything else.
 
@BartekBanachewicz would time(0) be acceptable for nonspecified seed?
 
Also, how do you parse things efficiently in a functional language? I’m stumped on that particular problem, state is kind of nice.
 
user1804599
Monadic parser combinators FTW.
 
Oh, is Gear written in Haskell?
 
user1804599
7:45 PM
The compiler is.
 
It is! Excellent. I must attempt to almost read this.
 
user1804599
The parser is kind of crappy.
 
user1804599
The rewriter is horrible due to &n which I have implemented in a terrible way (should've written something that rewrote the AST instead).
 
user1804599
Also, I should exit with a non-zero value if compilation fails.
 
user1804599
lol kwTrue *> pure (BooleanPattern True) instead of BooleanPattern True <$ kwTrue.
 
7:54 PM
@not-rightfold I really, really hate you. (almost five hours later)
 
Xeo
What was <$ again?
 
It's a broken <3
 
user1804599
@Xeo fmap . const.
 
user1804599
@kbok gold digger.
 
@not-rightfold what?
 
user1804599
7:57 PM
Dollar sign. :V
 
Errr. I hope you don't work for the NSA. I'm pretty sure they have an NDA over their PRISM source implementations :/ — sehe 13 secs ago
 
@not-rightfold Oh, nice
 
Oh, I made up a purely functional language
That’s kind of an interesting thought.
 
Xeo
@sehe lol
 

« first day (1036 days earlier)      last day (3927 days later) »