« first day (1527 days earlier)      last day (3404 days later) » 

10:00 PM
I think rightfold wrote a Monad tutorial once.
 
I may have written a monad once but can't tell cos I don't know what one looks like.
 
what's monad?
 
@Gemtastic A box that contains a value.
 
Hmm
 
10:05 PM
259
Q: Monad in plain English? (For the OOP programmer with no FP background)

figIn terms that an OOP programmer would understand (without any functional programming background), what is a monad? What problem does it solve and what are the most common places it's used? EDIT: To clarify the kind of understanding I was looking for, let's say you were converting an FP applica...

 
A monad has two operations: return (insert a value into the box), bind/>>= (apply a function to the value in a box to get another box with the result of the function).
It's as simple as that.
 
@Gemtastic Monad is a stupid concept that you won't have to deal with fortunately.
 
@Jefffrey Please don't try to explain Monads in a single sentence. It won't make sense to people.
 
@Unihedro I see?
 
It's important for IO because, the from the IO monad/box you can't extract the value, so the value is "trapped" inside the box. This prevents "side effect" from polluting non-IO code.
 
10:08 PM
@Jefffrey Again, this won't make any sense to someone without an FP background.
 
@FredOverflow lol
Wait, you are not joking?
 
It's some clever theorem that lead rise to it, only useful in functional fields.
 
@FredOverflow hmm, think I have watched that one
 
Java burns down the abstraction so it's the same as everything you already know.
 
@Unihedro In Java, you can simply say System.out.println or Math.random anywhere. The type system does not help you to control effects. Which is perfectly fine if you have the discipline to control effects yourself.
 
user1804599
10:13 PM
Monads are useful because you can implement algorithms that work on all monads once.
 
Eh I am not surprised, the fact that you can do it wrong doesn't mean you can't do it right.
 
@rightføld That's true for any typeclass.
 
user1804599
Exactly.
 
@FredOverflow The real problem is so many global-state APIs.
 
@rightføld That is correct algorithm-wise, but it doesn't change that everything still works.
 
10:14 PM
@Puppy Sounds reasonable. Can you back that up with an example?
 
sure
stdin/stdout/stderr.
filesystem access
environment variables.
 
user1804599
Just wait for Styx. :P
 
lots of that shit.
 
I thought you meant big libraries like OpenGL.
 
that shit is terrible too.
 
10:16 PM
lol, half of this room is lounge now
 
but well
that would not be possible if C did not permit such ridiculous global-state APIs.
 
28/29 december: the day the lounge conquered the java room
 
personally I intend to make all globals constant.
 
@Puppy Every language permits it, but C seems to encourage it more than others.
 
because handling real state is such a bitch there.
also
there are some standard library API changes you can make that make it easier to avoid.
 
10:19 PM
How does one hand timeouts on mobile?? halpp!!!
 
for example, I intend to pass at least stdin/stdout/stderr/env as Main arguments at the very least.
 
frantically turns on computer
 
censorship!
 
@Puppy Did you steal that idea from @rightføld? :)
 
no.
from memory he was against it too when I suggested it.
 
user1804599
10:20 PM
We had that idea independently.
 
user1804599
@Puppy No, I wasn't.
 
user1804599
I already had it in my mind for a long time, but I never talked about it.
 
ah
 
@rightføld Wow, you guys are like Newton and Leibniz.
 
well
 
10:20 PM
lol
 
I think that you don't have to go OMG-side-effects nuts.
but they should be a bit easier to avoid.
 
user1804599
I intend to pass at least these to main (list is in alphabetical order because I have CDO): command line arguments, environment variables, stderr, stdin, stdout, the directory in which the program was started, the file system, the network, the preferred encoding, the preferred locale, the process ID, the user which started the program.
 
user1804599
You can only get around it with FFI.
 
which Wide makes exceptionally easy.
 
Is there a language that allows you to call a member function with both obj.func(x) and func(obj, x)?
 
user1804599
10:22 PM
D allows both syntaxes for free functions.
 
@rightføld Wow, how many parameters does main have in total? :)
@Jefffrey D
 
Nice
 
user1804599
@FredOverflow One.
 
Also Bjarne proposed that for C++.
 
@FredOverflow The main thingy or the func(obj, x) thingy?
 
10:23 PM
So who linked this room in room 10?
 
user1804599
@FredOverflow Passing all of them separately would yield two problems: you have to remember the order and you have to take the ones you don't want to use.
 
@Jefffrey Depends on how you define "member".
 
@Unihedro Me
 
Wide supports that in some circumstances, but it's a bit happenstance.
 
@Jefffrey N4174
 
10:23 PM
What circumstances.
 
where obj is a module and func is an overloaded function and the calling code is also in the module obj.
 
@FredOverflow And it got declined?
 
so something like
 
@Jefffrey I have no idea about the current state of the proposal.
 
user1804599
@Jefffrey My current plan for Styx is that x.y, where x is not a module, is the same as (the module in which the type of x was defined).y.
 
user1804599
10:24 PM
There are no member functions, and every struct field defines a function that acts like a getter (like in Haskell records).
 
module m { f(arg) {} f(arg1, arg2) {} g(obj) { obj.f(1); f(obj, 1); } }
then pass m as obj.
this is obviously not what you actually intended and it's a bit circumstantial, but technically, it would have the same effect in these oddly specific circumstances.
 
I wish record syntax was a little better in Haskell.
 
fge
phew
Well, nasty swt bug
 
what's swt.
 
@Puppy Some Java GUI framework or something.
 
10:27 PM
also
you're a java programmer, stop acting like a human being.
 
@Puppy I don't understand how this is circumstantial or why does it have ... oh
you are using the module like if it was an object
 
it is an object.
 
I see
 
the Wide analyzer does not support expressions having different meanings in different contexts.
i.e., x.y must always mean the access of a named member of an object.
 
eh, you learned from the mistakes of C++
 
user1804599
10:28 PM
And from TypeScript. :P
 
user1804599
Puppy does Wide have ADL?
 
it does but it'll likely get the chop or be unused except for C++ interop in the future.
 
user1804599
If you do it don't make it implicit. :(
 
ah well
Wide ADL is nowhere near as bad as C++ ADL anyway because it only looks up in the context of the two arguments, not their base classes, their template arguments, their mother's dog's module, etc.
but I'll always need some form of ADL support to support using C++ classes that use ADL.
currently it is only for operators, too.
also only binary operators, I think.
maybe I got around to implementing it for unary operators at some point.
ADL for C++ types is of course regular C++ ADL.
 
fge
10:46 PM
<-- thought this was the Java chatroom
 
watching the thymeleaf class I missed
 
10:59 PM
@fge Just stay still and wait it out
This isn't the first time the lounge regulars hit our room
 
fge
"lounge regulars"?
 

Lounge<C++>

Today we're daydreaming about C++26 reflection
(weird people)
 
what are C people doing in this chat? C people hate Java. (do note tha C people != everyone who programs in C, just the ones who hates everything but C)
;P
 
@Gemtastic I don't think anybody in the lounge likes C. Well, I like it a little. But not much.
 
C in this case is collective for the C languages
 
11:07 PM
Clang, let it be
 
soo
back to java :D
 
@Gemtastic How is C++ a "C language", but Java isn't?
 
Java is built on C. C++ is also built on C. But later versions of Java is built upon older versions of Java.
Therefore, some people consider "Java7" as its own language, and thus "Java8" as its own, which is why you see this notation instead of the typical java-7 and java-8 in tags:
 
@FredOverflow If you said that, or even hinted to that Java is a C language to the people I refer to as "C people" your head would roll :')
 
@Gemtastic Anyway, I don't think there is such a thing as "C languages" encompassing more languages than just C.
C++ is not a C language, just like JavaScript is not a Java language.
 
11:12 PM
@FredOverflow That's not really a good catchphrase, while it's correct.
 
C, C# and C++ are the ones I know from the "C-family"
 
Well... You'd be surprised to know they aren't
Well, the joke is that C -> C++ -> C++++ (C#), but no
 
It's purely based on that C isw in it's name and it's a programming not scripting language
 
@Gemtastic How is C# more "C-ish" than Java?
@Gemtastic How are scripting languages not programming languages?
 
@FredOverflow It has a C in it's name. it has nothing to do with the actual language
 
11:13 PM
oh
Is Ceylon also a C-language? ;)
 
It could be
 
@FredOverflow yes
just like fish is an f-word
 
Does it have to start with C? What about Nice? Or Pascal?
 
Pascal isn't even a language. It's a joke at best.
 
Oh, COBOL is definitely a C language by that definition.
 
11:14 PM
Yes, it is.
// enterprise quality unproductive conversation (TM)
 
it's just that the people I refer to when I say "C people" are people who programs C, C# or C++ (possibly some other language involving the C) and they were very anti Java when I first sought out what language to learn
 
@Unihedro Have you ever been productive in a chat room?
 
@FredOverflow Yes.
 
amazing
 
for (var i = 0; i <= 100; i++)
    if (i % 3 != 0)
        if (i % 5 != 0)
            console.log(i);
        else
            console.log('Buzz')
    else if (i % 5 == 0)
        console.log('FizzBuzz')
    else
        console.log('Fizz')
See, I just wrote coder-quality FizzBuzz solution, and in under 10 seconds.
I am a god of all chatters.
 
11:16 PM
@Gemtastic Every programmer goes through that phase of being against Java. It usually passes.
 
@FredOverflow probably as they grow older and wiser? ;P
I don't go to those places to chat any more because they were so hateful :(
 
@Gemtastic As they realize nobody cares if they hate Java or not ;)
 
People with reddit accounts please help downvote this! reddit.com/r/Bitcoin/comments/2qkmwa/…
 
I think Java is mostly boring as a programming language, but you can get stuff done in it, and I make money with Java.
@Unihedro Why?
 
@FredOverflow Because I said please?
 
11:19 PM
@Unihedro Lounge<Buddha> has taught me not to care about people calling each other names on the Internet.
 
@FredOverflow Well, it went from -3 to -7 since I linked it, so I'm happy.
 
@Unihedro Does it get deleted automatically if it passes a certain threshold?
 
fge
phew Only the Long*Functions left
(and then there are all Operators
 
learning how to make the html less static
 
fge
Heh
Files.list(someDir).map(tryWith(Path::toRealPath).or(Path::toAbsolutePath))
 
11:36 PM
@Gemtastic Static pages are static.
If you want to have it change client-side, write some javascript. If you want more than that, you have to go with PHP.
 
@Unihedro more like you put stuff into the html to change the content, so the content won't be static
 
@Gemtastic ... it's still a static page, loads the same no matter which time you query
 
Well, but the content isn't.
 
A static web page (sometimes called a flat page/stationary page) is a web page that is delivered to the user exactly as stored, in contrast to dynamic web pages which are generated by a web application. Consequently a static web page displays the same information for all users, from all contexts, subject to modern capabilities of a web server to negotiate content-type or language of the document where such versions are available and the server is configured to do so. Static web pages are often HTML documents stored as files in the file system and made available by the web server over HTTP (...
 
fge
Isn't ThymeLeaf supposed to solve that kind of problem?
 
11:38 PM
@fge Yes, and that's what I'm learning
 
... Oh.
 
fge
Heh, there are so many templating engines out there for HTML that choosing one is becoming a chore
 
It's a "new" option instead of JSP
 
@fge Is that Java 8?
 
@fge templating engined?
 
11:40 PM
@fge php :(
 
fge
@FredOverflow with the help of the library I'm currently developing
 
nice
 
so... @fge ... how to run the tests?
 
fge
@Unihedro you haven't run anything yet? Then the easiest is right click on the test directory and select Run -> all tests (note: TestNG, NOT Junit)
 
11:43 PM
@fge Yeah, I just write them and hopes they pass, since I have no way of running them on IntelliJ - back on Eclipse there was a plugin that does this
 
fge
Otherwise there's a "Run" menu
Eh?
Intellij can do this too
Well, I'm so used to Intellij now that I just know how to manipulate it
Otherwise, run ./gradlew test
;)
Well, ./gradlew clean test
 
:D
 
11:59 PM
Ok, I've been watching this video for 30 min, and it's only 10min worth of teaching T_T
 

« first day (1527 days earlier)      last day (3404 days later) »