« first day (1570 days earlier)      last day (3380 days later) » 

5:03 PM
@рытфолд I feel like going full retard on a thing. Will ping you if I pull it off.
 
@AndyProwl I've never heard of Galileo being credited with its invention (nor any other one person). It's been invented (and re-invented) over the course of centuries, starting from the Greek philosophers like Plato and Aristotle. I believe Newton is usually credited as having put it into a close approximation of its currently accepted form (but that could be a matter of English influence on US education--as I recall, Roger and Francis Bacon were both given a lot of credit as well).
 
@JerryCoffin Italian education is probably biased then (or blatantly lying)
 
@AndyProwl I suspect both (all) are at least somewhat biased. Blatant lying strikes me as less likely.
 
user1804599
@JohanLarsson OK.
 
user1804599
@FredOverflow I know. :D
 
user1804599
5:05 PM
Tim Toady said that in a talk yesterday.
 
user1804599
At FOSDEM.
 
user1804599
It will probably not be called "Perl 6 v1.0.0" though.
 
user1804599
Ok, screw Lua. I'll use LLVM instead.
 
user1804599
@Puppy do you know if it's possible to make LLVM give me a callback when first calling a function so I can lazily generate IR for functions?
 
user1804599
With JIT.
 
user3079266
5:09 PM
hey @рытфолд, why'd you spell your nickname in cyrillic? =)
 
user1804599
> When lazy compilation is off (the default), the JIT will eagerly compile every function reachable from the argument to getPointerToFunction. If lazy compilation is turned on, the JIT will only compile the one function and emit stubs to compile the rest when they're first called.
 
user1804599
There is this, but it's not a callback.
 
user1804599
The function signature is known beforehand, though.
 
user1804599
Oh MCJIT doesn't support lazy compilation at all.
 
@Mints97 His name is leased via DHCP. Every few months, he reboots and his name changes.
 
user1804599
5:14 PM
@MartinJames Ahem.
 
user3079266
@MartinJames oh, I see =) I was just wondering at the name change and the strange spelling
 
@Mints97 Some say his species changes too.
 
user1804599
@MartinJames Ahem.
 
oi @Mints97
 
user3079266
oh, hey @BartekBanachewicz, long time no see!
 
5:17 PM
@Mints97 righty. I kept my promise of not venturing to the C room again as you can see.
 
user1804599
ok so problem is
 
user3079266
@BartekBanachewicz pity you did. it hasn't been as much fun without you around =)
 
user1804599
if types can be created at runtime
 
user1804599
I can't optimise member access for objects of those types for existing functions.
 
dunno, maybe I'll pop in there sometime
 
user1804599
5:18 PM
for example
 
when Peter is not around
 
user3079266
he's never around lately
 
@Mints97 I'm typically here, in the JS room and in Haskell room.
 
user3079266
he got a new job and never comes online 'cos he's so busy. Now the room's dead dull most of the time
 
user1804599
sub f () do makeStruct {"x": Int, "y": Int} end
let T = f ()
sub g (x: T) do print (x.x + x.y) end
 
user1804599
5:19 PM
But I can optimise that when I can lazily generate IR for functions.
 
user3079266
@BartekBanachewicz I know, but I'm quite distant from both languages, so I didn't really feel like I'll be at least a bit in place in either...
 
@Mints97 bah a pity you didn't get to learning Haskell :(
 
user3079266
here, I can at least understand what everyone's talking about (most of the time)
 
@Mints97 might be because we scarcely ever talk about programming here :P
 
user3079266
5:21 PM
@BartekBanachewicz IKR? But univ keeps me busy as heck lately! It's all C#, C# and C#, and after all that time, I still can't make a sound on topic in the Foo Bar (C# room) 'cos I still don't know the aspects of the language they're talking about! =(
 
user3079266
@BartekBanachewicz oh right I noticed =)
 
@Mints97 Don't worry, the more languages you know the easier it is to expand; a lot of concepts are very similar.
 
Is there a hack to make either a) 0 a valid property name b) 0.0 a valid property name (in C#)
 
user3079266
@BartekBanachewicz oh yes, I understand that... But even that doesn't always hold true =) take Prolog, for example. Procedural? No. Functional? No. Object-oriented? No. Unique? perfectly unique. And still widely used.
 
user3079266
@JohanLarsson Don't know... But I guess not =)
 
user1804599
5:26 PM
@JohanLarsson Perhaps public int \u0030 { get; private set; } works, but I'm not sure.
 
@Mints97 Don't fear the C# room. They are friendly kids.
 
@Mints97 Not really all that widely used. And it's a "logic programming language", which is pretty much its own class (of which Prolog is almost the only member, admittedly).
 
@рытфолд It compiled but does not show up in intellisense
 
@Mints97 It's declarative.
 
5:27 PM
@CatPlusPlus Now I really want a burrito. Damn you Cat.
 
user1804599
@JohanLarsson nice.
 
user1804599
You can then also say foo.\u0030, of course.
 
user3079266
@BartekBanachewicz oh, yes, you're right, it does fall into a category!
 
user1804599
@JohanLarsson File an IntelliSense bug.
 
user3079266
geez, you guys are cool. You just went ahead and broke IntelliSense in 3 seconds with just a weird at-the-moment idea! :D
 
5:31 PM
@EtiennedeMartel I had a burrito for supper last night. It was really good. Oh, now I guess I'm being evil too. Oh, but it's about lunch time for you, isn't it?
 
@JerryCoffin Exactly.
 
@рытфолд fiddle is even more broken.
 
user1804599
Hmmmm.
 
user1804599
You can write IL assembly.
 
user1804599
I don't see why you'd want to do this, though.
 
5:32 PM
This must show up in intellisense
 
@EtiennedeMartel If you've never had one, I recommend a California burrito--a burrito with French Fries in it. French fries, cheese, some meat and some sauce--almost like poutine with a wrapper so you can eat it one-handed! :-)
 
Oh shit that sounds delicious
 
@рытфолд I have addresses like "DB110.DBX0.0" wanted to generate types & fluent interface so one can write it without " and complietime checked
Got stuck on the last int.
The first part was two minutes with a T4 template
 
user1804599
brb shower
 
@EtiennedeMartel So I guess you don't need to think a lot about what to have for lunch. The only question is where to get it...
 
5:36 PM
what's a good thing to 3D model for a beginner?
 
@EtiennedeMartel Seems Burrito enjoys intense popularity these days
@рытфолд I was gonna say. Don't forget these armpits...
@corvid Chess pieces
 
cool cool, thank you sir
 
@sehe Good call--can start out almost trivial, then you can add as much more detail as you like.
 
Let's say I have constructor with no parameters and a constructor with 1 parameter. I want the 1-param constructor to have access to functions that the constructor with no params shouldn't.

For example, Matrix(int numx) initializes an augmented matrix. Matrix() initializes a matrix. I want Matrix::findX(); to be only available to the former. How can I adjust for this?
 
by not doing anything
think about what would happen if we had to explicitly remove access from member methods in methods that didn't use them
 
5:43 PM
@AlexM. If I do Matrix d3() followed by d3.findX(); that's going to result in a runtime error
 
you mean exception
 
Yeah
 
an IndexOutOfRange exception
right?
 
Yes.
 
well heaven forbid we use exceptions
 
5:44 PM
Well, what would happen if we explicitly removed access to findX from d3?
 
I have no idea why I even suggested anything
disregard what I said
 
Thanks for the help.
 
fuck me this day is not ending
 
Xeo
> MINECON will be in London on July 4-5, 2015!
lawl
So close, yet so far from Unconference 2.0
 
@AlexM. I'm positive it will
 
5:56 PM
@рытфолд here is the stuck.
 
user1804599
@sehe I didn't.
 
@DonLarynx If there are differences in behavior they support after being constructed, then these should be constructing instances of two different classes, each of which includes member functions only for the behavior it supports.
 
@рытфолд Thanks on behalf of the community
 
user1804599
 
@JerryCoffin Thanks Jerbear
 
user1804599
6:00 PM
OTOH lazy compilation makes inlining pretty much impossible.
 
user1804599
It'd be nice if I could enable it on a per-function basis.
 
@DonLarynx If one of those is a proper subset of the other, then you might be able to use inheritance to model the relationship between them. Otherwise, they might both derive from some common base class that embodies what they have in common. But note that inheritance tends to be over-used and can lead to clumsiness elsewhere in the design, so be sure you're really gaining something useful from it before committing to such a design.
 
@sehe not with me on this chair I hope
 
user1804599
Also hash table vs pair vector for pointer keys when there are less than ten keys.
 
QA days are horrid
QA doesn't fear overtime
QA embraces it
 
user1804599
6:02 PM
And read-only.
 
@JerryCoffin Thanks again!
 
@DonLarynx Surely.
 
hello from rustland
 
user1804599
Hello there little hipster.
 
ur actaully right about that
 
6:03 PM
@рытфолд I'm waiting for a PR :)
 
but not one in real life :)
 
@Apoph1s @рытфолд can say that because he's not a little hipster (he's a big hipster).
 
I want food
and alcohol
 
user3079266
Rustland? That sounds almost like Russland! =)
 
Rust is my first low-level lang
 
user1804599
6:05 PM
@JerryCoffin Ahem.
 
I have a 'Thread' object which has a std::thread member. The std::thread executes a member function Thread::run() to process events in a loop. What happens if I call ~Thread from within an event posted to said loop? ... I'm so confused.
 
user1804599
@JohanLarsson Then you can wait a long time.
 
why so grumpy?
 
user3079266
@Apoph1s oh, that's cool!
 
user1804599
@Pris Then the destructor of the std::thread object will be called.
 
6:07 PM
@Pris Why do you call destructors at all?
 
@рытфолд I think I finally get RB trees now. Somehow that makes me want to write an RB tree tutorial. This is what understanding Monads must feel like!
 
user1804599
Do you also understand lazy compilation in LLVM help
 
Are there lots of tutorials on the subject? Then it must be impenetrable.
 
user1804599
No. :(
 
@LucDanton Right, we have DCDM for that; Don't Call Destructors Manually. Oh wait, some idiot called it RAII instead.
 
6:09 PM
@рытфолд but the thread is still executing (Thread::run())...
 
user1804599
SSCCE.
 
...or GTFO
 
@LucDanton because I'm a bad developer and dealing wiht some corner case where an object's lifetime gets extended
 
user1804599
 
user1804599
6:11 PM
amazon y u recommend terrible items
 
rightfold has caught the Agile virus!
 
sigh
 
user1804599
I'm agile and web scale.
 
Which ends up with me inadvertently calling the destructor. When exactly do the members of an object instance get obliterated? It has to be some point after the destructor is called right?
 
@LucDanton I've done so at times. Most often when implementing a container that had to allocate raw memory, use placement new to construct objects in-place, and directly invoke destructors to destroy those objects when (for example) they were erased.
 
6:12 PM
41
Q: Object destruction in C++

FredOverflowWhen exactly are objects destroyed in C++, and what does that mean? Do I have to destroy them manually, since there is no Garbage Collector? How do exceptions come into play? (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in...

 
user1804599
All this RAII crap reminds me, I should implement my garbage collector.
 
@рытфолд OOA&D isn't bad. The "head first" crap is, well, crap though.
 
@рытфолд Who is Tim Toady?
 
i guess i can artificially extend the lifetime of things i care about by using a shared_ptr and adding references in Thread::run(). I feel so dirty
 
user1804599
Larry Wall (/wɔːl/; born September 27, 1954) is a computer programmer and author, most widely known as the creator of the Perl programming language. == Education == Wall grew up in south Los Angeles and then Bremerton, Washington, before starting higher education at Seattle Pacific University in 1976, majoring in chemistry and music and later pre-med with a hiatus of several years working in the university's computing center before graduating with a self-styled bachelor's degree in Natural and Artificial Languages. While in graduate school at University of California, Berkeley, Wall and his wife...
 
6:14 PM
@рытфолд Everybody should implement a garbage collector once or twice. It's an interesting exercise.
 
@рытфолд So is Tim Toady a website about Perl or what?
 
user1804599
Ugh.
 
user1804599
Neither Larry Wall page nor TIMTOWTDI page mention that Larry Wall has Tim Today as his nickname.
 
@JerryCoffin Seems pretty boring to me. Mark all objects unreachable, then traverse the object graph and mark the onces you find as reachable.
 
user1804599
@FredOverflow That's the boring part.
 
user1804599
6:16 PM
The fun part is making it perform well.
 
user1804599
And dealing with concurrency.
 
dealing with concurrency is fun?
what planet are you from
 
user1804599
I will at first just have one GC per fiber, and make each object have a reference count which contains the number of GCs that hold on to the object.
 
@FredOverflow Just that (the mark part of mark/sweep) isn't very interesting. It gets a lot more interesting when you decide to do incremental collection, concurrent collection, generational scavenging, and so on.
 
user1804599
Because that solves the concurrency issue easily, and doesn't require full-world stopping.
 
user1804599
6:18 PM
Compacting must be fun.
 
@рытфолд Depends on whether you use an object table or not. Using it is usually easier, but not using it is usually more efficient.
 
user1804599
In my current idea each GC stores a set of shared pointers.
 
user1804599
Immutability makes everything only more fun.
 
@рытфолд Immutability removes most (if not all) "stop the world" problems.
 
user1804599
Yeah.
 
user1804599
6:21 PM
Well apart from the root set.
 
user3079266
Hmm, I'm not very familiar with GC theory, but I heard that there was an approach where you just kept counting the references 'till you've reached some limit, and then start freeing all memory that is no longer referenced in any thread stack... is this correct?
 
we have no GC :)
 
user1804599
Only channels are mutable.
 
user1804599
As in they store two mutable queues of functions.
 
user1804599
Receiving and sending are primitive operations (in the VM, not in the language) and the only way to communicate between fibers.
 
user1804599
6:24 PM
So receiving just registers the object with the fiber's GC.
 
user1804599
Mutable variables can be implemented with a fiber and two channels.
 
user1804599
Making them inefficient as hell, which is nice.
 
user1804599
(Mutable variables suck.)
 
@Mints97 Doesn't sound like a form of GC with which I'm familiar, but that could just be my limited scope of experience.
 
@JerryCoffin ...and you think every programmer should do that sometime...?
 
user1804599
6:28 PM
I can optimise side-effect free infinite loops to (makeChannel ()).receive, which makes the fiber a target for garbage collection!
 
@рытфолд To prevent hash collisions from making hash data structures degrade to O(n), why do people not combine hashing with trees? That is, use an array of trees and then index into that array of trees with hashing.
 
@FredOverflow Should at least write a simple one, test it enough to realize its shortcomings, and study newer designs enough to have at least some idea of what they do about those shortcomings.
 
user1804599
@FredOverflow Collisions occur very rarely and creating and traversing very small arrays can be much faster than trees.
 
But the trees will be very shallow in normal cases; 0, 1 or 2 elements, maybe.
 
6
A: When should I do rehashing of entire hash table?

Jerry CoffinThis depends a great deal on how you're resolving collisions. If you user linear probing, performance usually starts to drop pretty badly with a load factor much higher than 60% or so. If you use double hashing, a load factor of 80-85% is usually pretty reasonable. If you use collision chaining, ...

Sometimes they do...
 
user1804599
6:30 PM
Hmm. In C++ can you cast D* to B* where struct D { B x; int a; int b; } and struct B { int c; int d; } like you can in C?
 
Or are you saying that a 1000 element array is still faster than a 10-deep tree?
 
user1804599
And dereference the result of the cast operation?
 
user1804599
Without UB?
 
user1804599
When D and B are POD?
 
My gut says yes.
 
6:32 PM
I think I've pissed my first student off.
 
Are you implementing duck typing or something? :)
@Jefffrey ...off, right?
Or are students literally coming out of your urethra?
 
She asked for an audio lesson, we did that, then she asked for another and now she doesn't answer me anymore. :c
@FredOverflow lolyeah
 
user1804599
@FredOverflow Yeah.
 
@Jefffrey What's "doing an audio lesson"?
 
And I saw her being busy which means that she was in another lesson with some other tutor.
@FredOverflow Tutoring online via mics.
 
user1804599
6:34 PM
@FredOverflow But with optimisations.
 
user1804599
For example, objects of struct types will have struct-like layouts instead of hash tables.
 
Ell
@Jefffrey what did you do?
 
I dunno.
She said she was happy, but then apparently we broke up.
 
Did you have feelings for her?
 
user1804599
And given struct Person feature name: String; age: Int end, sub f (x: Person) do print x.name end will directly access the member instead of going through a lookup function.
 
user1804599
6:35 PM
Even though this language is dynamically typed.
 
Ell
@Jefffrey broke up? as in under a tunnel broke up?
 
user1804599
There is no inheritance, so this is completely safe.
 
@FredOverflow Well, she was my first student.
We did 2 hours and 35 minutes straight the first time.
 
Wow. You must be sore.
 
She was super happy with me and I got all worked up.
 
6:36 PM
what were you teaching?
 
user1804599
Now if you say sub f (x: Top) do print x.name end it will have to go through a lookup function, of course.
 
Ell
You need to relieve your sexual frustration through some other means
 
Problem is that with text you can show interest and feel all welcoming and stuff.
 
Ell
Putting that on your student can't be good
 
user1804599
Since the JIT compiler doesn't know the offset of name since Top isn't a struct type.
 
6:37 PM
With voice you cannot fake much.
 
@рытфолд That's because he has no such nick name
 
Ell
you just need practise
 
user1804599
@sehe It's definitely his nickname.
 
@Pris it is
@рытфолд Nope. Read closely
 
Like she began talking about how defining functions in Python reminded her of matrixes.
And I was like... wat
But I had to say "Yeah, I know what you mean"
 
user1804599
6:38 PM
@sehe you pedant!
 
@Blob Python
 
@рытфолд You bad typist!
 
Very basic python.
 
@sehe masochists, the lot of you
 
user1804599
And this is where lazy compilation also kicks in.
 
user1804599
6:38 PM
If you say let T = f() then it's not known at compile-time what type T is.
 
Also I felt like I wasn't able to make her understand something.
 
user1804599
But when functions are compiled lazily this will be known.
 
user1804599
And it's safe since T is immutable.
 
Ell
@Jefffrey meh, kinda makes sense if it's a big n*2 matrix :P
 
@Jefffrey start with c++ so python looks like english to her.
 
6:40 PM
@Jefffrey What? No you don't. Women don't like yay-sayers. You gotta say nay if you mean it.
 
Like there's something very basic that she is missing but I'm not sure what it is. So every once in a while I repeated some other basic stuff (like ordering of functions or for loops or variable names or types), and she did understand all of them. But them in some cases she would make mistakes that made me think she didn't actually understand some topic.
@Blob lol
@FredOverflow oh, thanks for the tip
 
user1804599
@FredOverflow disagree
 
I've heard about this student the other day who couldn't grasp the difference between condition and if (condition).
 
user1804599
The more programmers there are, the fewer well-paid jobs there are left for me.
 
Like I made her write:
 
user1804599
6:41 PM
@FredOverflow Must've been a noob.
 
@рытфолд Nobody can be taught to think like you, rightfold.
 
@рытфолд don't worry, most new "programmers" are just learning php. your real job's safe.
 
def func(x, l):
    for x in l:
        ...
 
user1804599
Should've made her write fuck instead of func.
 
@рытфолд Well, she was a 7th or 9th semester student, taking a 1st semester class.
 
6:41 PM
And then I said: "Ok, the syntax is ok, but you have variable x in the for loop that shadows x in the function definition.
So she said she understood and fixed that by changing the name.
 
user1804599
@FredOverflow My assumption was correct.
 
@Blob Is PHP the new Ph.D.?
 
Then the next step was to add another loop. And she wrote something like:
 
user1804599
Ph.P.
 
@Jefffrey i think it'd be easier to just say "one x at a time, please" rather than trying to get the precedence across
 
6:42 PM
def func(x, l):
    for x in l:
        for x in y:
            ...
 
Ell
@Jefffrey and you think a noob could understand that? :P
to me it sounds like she doesn't understand either a for loop, or what the parameters do
 
@Ell I've then proceeded explaining what I meant with function definition. How a function definition related to "normal code flow" and and how a for loop has a different scope then that of the x.
 
user1804599
 
user1804599
if only someone (ME ME ME) made syntactic sugar for it
 
Ell
@Jefffrey it sounds like you're starting out too complicated to me
 
6:44 PM
But then she came up with this syntax for function definitions:

def func(str, list) -> str:
...
 
user1804599
@Jefffrey You can do this in Python.
 
is that valid python?
=o
 
and I was like: "Awww, she thinks in types using Python. That's so sweet".
 
user1804599
def func(x: str, l: list) -> str:
    ...
 
wait, you can?
 
user1804599
6:44 PM
Yup.
 
user1804599
I even made a decorator that inserts type checks.
 
Real Python or rightfold Python?
 
Oh, I told here that python was dynamically typed (explaining what that meant) and told here that it wasn't necessary.
 
what
 
Ell
Real python
it doesn't do anything :L
 
6:46 PM
@рытфолд Python 3?
 
That's annotations, it can contain anything
If you want to use them for typechecking you need support code
 
Oh, I see.
 
user1804599
@Jefffrey It's not necessary, but I laugh at people who enjoy "object has no attribute foo" somewhere in the function better than "expected T, got U" at the very start of the function.
 
x: y, w: z is like an hash, right?
But what is -> str?
 
6:47 PM
No, it's just additional metadata
Sort of like
 
user1804599
IntelliJ also autocompletes based on attributes.
 
@Jefffrey probably return type like with auto in C++
 
woops, bbl
 
user1804599
And there is a static checking tool in the making based on attributes, but analyses the AST rather than at runtime.
 
def func(x, l):
   ...
func.arg_annotations = { 'x': str, 'l': list }
func.ret_annotation = str
Not actual implementation
I don't remember what's the attributes
Also don't remember if they need to be identifiers
 
user1804599
6:50 PM
Does object being an instance of object cause trouble WRT Russell's paradox?
 
user1804599
>>> isinstance(object, object)
True
 
type is an instance of type
And object is an instance of type, and type is an instance of object
 
user1804599
Everything is an instance of object!
 
Even I am an instance of object
 
Ell
@corvid pfft you wish
 
6:58 PM
user image
6
 
Ell
lol
 

« first day (1570 days earlier)      last day (3380 days later) »