« first day (1075 days earlier)      last day (3871 days later) » 

1:00 PM
I was going to search for it on the googles, but I checked SO first and there wasn't anything about it at all so I figured I might as well contribute.
 
This was a silly waste of time.
 
@R.MartinhoFernandes Hmm ?
 
I want a nice way of running queries on the UCD, and C++ is sort of horrible for that. ICU doesn't quite cut it because I want access to all properties and ICU does not expose the ones that are only meaningful for the algorithms. So Haskell.
 
Xeo
I like how you can qualify multiple imports to the same name
 
@Xeo I actually only learned it now that I tried it.
The namespace pollution controls in Haskell are just great.
 
1:16 PM
by the way
I was thinking in Wide that I would reject generating assignment operators that are not strongly exception safe.
 
@Borgleader Don't accept my answer tho, pick the other one. I feel like mine is too chatty.
 
@Xeo Excuse me for being stupid, but I don't see how that's a good thing.
 
@Borgleader it just gives you more flexible namespace control
 
@BartekBanachewicz I'm waiting a bit just in case Nicol Bolas somebody else comes along ;)
 
@DeadMG Maybe with an option to force it?
You know, the usual "shut the fuck up, I know what I'm fucking up"
 
Xeo
1:19 PM
@Borgleader It allows you to use related modules through the same name.
 
@Borgleader Nicol rarely jumps in on "standard-explanation" type of questions. He is either answering "why doesn't it work" or "why is opengl bad"
 
@R.MartinhoFernandes That would be practical as an implementation extension, but not something I could put in the specification.
 
If there was an tag, I might compete with him, I think :P
 
@DeadMG Why not? I mean, in C++ you can ask for stuff = default;. I didn't mean a compiler option.
 
oh, hmm
I wasn't planning on including =default, but I think that the alternative I had in mind would not be an exact replacement.
 
1:20 PM
Can std::shared_ptr and family be called "garbage collection"?
 
@Jefffrey no
 
-1
A: What is responsible for deleting my pointer?

John SmithI think the best way is to use handle or a resource management wrapper or RAII which means you should use shared_ptr or unique_ptr. They are the so called "garbage collection mechanism" in C++ which is not the real/same garbage collection mechanism as in Java. The way they do it is by using th...

 
@Jefffrey Some people do, some people don't. I'm more of the mind that it can't.
 
I've even edited it to be "smart pointers", but he rolled it back.
 
there's no garbage involved; only data
 
1:22 PM
I think you guys are overdoing it.
 
Garbage is data that's not referenced by anything, and thus is useless
this never happens with smart pointers
"data collection" is a good term to describe both at once
 
@Borgleader Want fine grained highly nested namespaces? Fine. The nesting and different names don't really help readability? Just bring everything in under the same name. Want only a few names from a namespace? Bring only that name. Pretty much any choice you could want to make you can.
 
Xeo
@R.MartinhoFernandes Can you qualify only certain names from a module?
 
import Foo(bar)
import qualified Foo
-- works
With that you get bar, Foo.bar, and say, Foo.qux in scope.
 
Xeo
-- and likewise
import Foo
import qualified Foo (bar)
-- ?
 
1:26 PM
Dunno.
You can import Foo hiding bar
 
Xeo
yeah
 
Morning by the way.
 
Xeo
My situation was that I wanted import Text.Parsec, except for oneOf, which clashed with some other oneOf, and so I wanted P.oneOf or something
of course I could just hide that other oneOf from Prelude
 
I need help with a thing, rather fast.
 
Xeo
Hospital?
 
1:28 PM
@Xeo import Text.Parsec hiding oneOf; import qualified Text.Parsec would do, I think. (semicolon only for exposition)
 
My class is crashing on a destructor in a rather unusual run scenario
A destructor is a simple if (id) glDeleteTextures(1, &id), I am getting access violations from it.
 
Xeo
@R.MartinhoFernandes That would enable Parsec.oneOf or Text.Parsec.oneOf?
 
Latter. Add as as necessary.
 
is there a possibility taking an address of a member variable would generate access violation?
 
@BartekBanachewicz Sounds like an unrelated matter.
Some UB elsewhere.
 
Xeo
1:29 PM
Well, I can already disambiguate with Text.Parsec.oneOf without the qualified import :)
 
@R.MartinhoFernandes hmm
 
Xeo
(which is what I'm doing atm)
 
@BartekBanachewicz Just to be sure, add a && glIsTexture(id) to the if.
 
building...
 
Ell
@deadmg is it easy to infer whether a function is exception safe?
 
1:33 PM
@Jefffrey GLuint
@R.MartinhoFernandes the same :/
 
@Ell Not in general. But for some compiler-generated operators, it's relatively trivial to know if the result will be exception safe.
 
Then yeah, something terrible elsewhere.
 
all exception-unsafe functions generally follow the form of statement with side effects; statement that may throw;.
 
it's an ad-hoc solution, but I have no idea why the fuck that would crash
so if you see nothing wrong with it, I have to run through rest of the code
 
1:35 PM
this is trivially true for a class that is, say, class x { std::string x; std::string y; }.
 
> glDeleteTextures silently ignores 0's and names that do not correspond to existing textures.
 
the default assignment op will call the assignment op of the two members
 
So apparently if (id) is useless.
 
but if the second one throws (bad_alloc let's say)... the first mutating side effect has already gone through.
 
@Jefffrey it is, w/e
 
1:36 PM
frankly, I'm not sure how applicable such a warning about exception unsafety would be to general functions.
 
@DeadMG More like "statement that breaks invariants; statement that may throw", I think.
 
@R.MartinhoFernandes "Breaks invariants" would be no exception safety. "Has user-observable side effects" would be weak exception safety.
 
Xeo
Hmm... can I use a variable for pattern matching?
 
exception safety is like concurrency, it's difficult because it's non-composable.
 
@DeadMG The compiler doesn't have enough information to avoid many false positives.
 
1:38 PM
@R.MartinhoFernandes found it, no default 0 value.
 
user1804599
@Xeo | x == y.
 
@BartekBanachewicz Wait, how was glIsTexture(id) true, then?
 
user1804599
Haskell isn’t Erlang. :P
 
@R.MartinhoFernandes Hmm. I'm not sure that would be true in Wide, since I plan on checked exceptions.
 
@R.MartinhoFernandes no idea.
the bug only appeared when generating docs :/
 
Ell
1:40 PM
As in noexcept or throws list_of_exceptions ?
 
Xeo
@not-rightfold Hm, kinda weird, since you can patternmatch against literals at least.
 
You can infix variables.
 
Xeo
hm?
 
You know, a `f` b
 
@Ell throws list_of_exceptions.
 
Ell
1:44 PM
I always wonder how that works with virtual functions. Are they allowed to add tothe list?
 
How would you expose a std::multimap<foo, bar> through a C API?
 
git rebase --abort is my best friend
 
Xeo
@R.MartinhoFernandes Yes, and?
 
@Ell Definitely not.
 
Ell
Also, I take that it won't be as strict as Java?
 
1:44 PM
@R.MartinhoFernandes I never worked with multimap.
 
Ell
Or will it?
 
probably more strict.
well.
 
@DeadMG It's isomorphic to a map<foo, vector<bar>>.
 
Xeo
@R.MartinhoFernandes allow query for number of same-elements, and accept an index for the nth same-element you want for a given key?
 
Just easier interface.
 
1:45 PM
obviously, this is just my current plan, and it might turn out that actually doing that shit will be way more arduous than I expect, and I'll cut it.
 
@Xeo Nah, I want to return one of these beasts.
 
Xeo
oh
 
but in my fundamental opinion, the problem with Java's checked exceptions has nothing to do with the fact that they have checked exceptions.
 
Xeo
good luck
 
it's all about the usability
i.e. none.
I figure that it could be a great feature if you packed it with some more advanced compiler technology, like exception specification inference.
 
1:46 PM
Maybe an array of pairs.
 
Ell
was about to say
it being inferred would be a big plkus
 
similar to how functors are fantastic in C++
but functional APIs are almost unusably painful without lambdas.
 
@BartekBanachewicz are you working on opengl done right?
 
@Jefffrey nah, I'm at work. My GLDR wrappers were a tad better than this one
 
Xeo
1:47 PM
@DeadMG Wouldn't be if C++ had first-class overload sets :P
 
The values are strings.
Argh.
 
Xeo
array of array of array?
 
@Xeo Hmm. That would be less painful, but you'd still have problems.
Wide has first-class overload sets and I still use a load of lambdas.
 
Ell
googles first class overload set
 
Xeo
for what reason?
 
user1804599
1:47 PM
@Xeo Because those are constructors.
 
because overload sets cannot be stateful (except this as a bit of a special case).
 
Xeo
@Ell save yourself the googling: overload sets that can be passed around like functors
 
lambdas can be.
 
Hmm, the set of keys is finite.
 
Xeo
@DeadMG partial application~
 
1:49 PM
Maybe instead of c_multimap_craziness f() I can have c_array_craziness f_for_key(key k)
 
@Xeo Which would basically be the same as lambdas, except the body wouldn't be written inline.
 
user1804599
In Erlang you can do sub(X, X) -> 0; sub(X, Y) -> X - Y.. :3
 
Xeo
yes
and that's good
default-currying / partial application is so nice because it saves a good deal of typing
 
@Ell we're in the land of @Xeo's weird ideas
 
Xeo
Hey, it's not weird. >:|
 
1:50 PM
it's about C++, of course it's weird
 
user1804599
C++ is nice.
 
In Haskell I use lambdas mostly for scoping :|
 
Xeo
@R.MartinhoFernandes let?
 
@Xeo Nah, I mean stuff like execute-with.
 
Xeo
mh
 
1:51 PM
  allocaArray size $ \buf ->
    do c_get_name u buf
       fmap T.decodeUtf8 $ packCStringLen (buf, size)
Like this.
 
@not-rightfold it's gotten to the point where everyone ignores your statements of this kind
 
Xeo
ah
 
buf is a scoped array.
 
Xeo
I was gonna guess it has to do with a do block
 
1
Q: How to expose properties to Lua Library from C++

kapserI want to how we can expose properties to lua library. luaL_openlib( L, kName, kVTable, 1 ); // leave "library" on top of stack With this, I am able to expose only functions as kVTable refers to luaL_Reg typedef struct luaL_Reg { const char *name; lua_CFunction func; } luaL_Reg; Eg: Wit...

@kbok ^
 
Xeo
1:53 PM
@R.MartinhoFernandes So bracket like stuff
 
Xeo
One thing I don't quite get yet, btw, is how the fuck catch in Haskell works
 
Functions that take "blocks", not functions that take functions. In my head there's a clear difference between the two, even though there isn't one in the language.
 
Xeo
or is it magic?
-XNoMonomorphismRestriction <3
(because I'm lazy and don't want to provide type-signatures for my parsers)
 
@Xeo It works inside IO...
 
Xeo
1:55 PM
@R.MartinhoFernandes Magic!
 
> If you use C++, you can use a binding library, such as the header-only luabridge
ugh
.addVariable("SOME_CONST_1",&some_const_1,false/*read-only*/)
ugh
 
@Xeo Only because of IO. If you have your own monad stack without IO you can have a catch that needs no magic. See hackage.haskell.org/packages/archive/mtl/latest/doc/html/…
 
Xeo
Ah, true
Monads ♥
 
@BartekBanachewicz: Among other things, most electronics (including most computers) draws a fair amount of extra power while starting up, so I suppose it's at least possible to have a computer that would run, but if stopped couldn't boot again. That said, I don't think it's particularly common.
 

« first day (1075 days earlier)      last day (3871 days later) »