« first day (486 days earlier)      last day (4452 days later) » 

2:21 PM
@Damian Because you're already at the bottom? :)
 
@StackedCrooked Sorry it is finance... so this relates to credit ratings of companies which are set by Moody's... AAA for good rating, BB for bad (default)
you as in company
 
I see I've missed some fun time with mods yesterday. :(
If anyone cares, I don't see a problem with moving the book list to our wiki, really.
 
yeah, it was hilarities
@CatPlusPlus I don't either, in concept, but the wiki simply won't scale enough, IMO
 
Why not?
 
2:32 PM
the biggest problem I have is that wikis are practically invisible
 
because it's just a giant wall'o'text
 
I mean our wiki, not tag wiki.
 
look at the size of some of the other reference-style material we have, like the C++ FAQ on operator overloading
ohhhhh
that could work, double true
 
that might work
 
It can be then linked from tag wiki.
 
2:33 PM
it just seems like it ought to be part of the main site
 
Well, my point is we don't have to be exactly dependent on main site.
 
well, yes, that's true
but then we could just get this chat somewhere else, like IRC, and ditch SO entirely
 
It's bit more comfortable than IRC, though.
 
I wonder if you could link a wiki back to SO with the API
 
true
 
2:35 PM
so users on SO are all users on the wiki and have their profile/rep
 
Not on wikidot.
 
@CatPlusPlus I miss the history and the threaded replies whenever I user IRC now
I might have a look on stackapps
 
I think they have auth in API now, so it should be possible, but would also mean moving the wiki.
 
@CatPlusPlus they have V2 of the API which I think does authentication now
it used to be read only
 
Yeah, OAuth.
 
2:42 PM
Roses are red,
violets are blue,
not true equals false,
and not false equals true.
 
Roses are red,
Violets are blue,
These poems suck,
And so do you.
 
"The obvious poem".
 
lol
 
Roses are red,
Violets are blue,
PC LOAD LETTER.
2
 
lol
 
2:50 PM
According to the C++ standard does it make sense to write anywhere void in the function arguments, if a function takes no argument.
 
you can legally do something like int f(void);
but it's heavily disapproved of
 
Like

class MyClass {
static void someMethod(void) {
..
}
};
 
It's C-ism.
 
it's an old C jobbie and has no place or meaning in C++
 
It's equivalent to empty argument list.
 
2:51 PM
if you find it outside of legacy C code, then that reads "The original programmer had no idea how to code C++"
 
yeah right that's what I remember
 
void is the meaning of my life on a day like today
 
"And you are extra likely to find a billion other bad ideas in the code"
 
seems Lua interpreter is really easy to write in C++
 
why would you want to? Lua's a pretty terrible language
 
2:52 PM
All interpreters in all languages seem simple, until you start implementing it.
2
 
In C accodring to the starndard you have to write void. Otherwise myFunction() declares a function with arbitrary arguments or something.
 
it's simple, but doesn't have much going for it beyond that
@Nils We know. That's what makes it a C-ism.
 
@CatPlusPlus +1
 
ok
thx :)
 
@TonyTheLion I'm trying to rewrite it to C++, and it's not easy =(
 
2:53 PM
huh. yea, it's all easy until you look at the details
so, don't look at the details :P
 
@Abyx AFAIK nobody has written a C++11 implementation completely yet
 
@Abyx Lua is a pretty simples language. I bet that I could crack up a working-ish interpreter in a couple of days.
 
it has raw pointers, meh
 
@TonyTheLion Obviously you'd re-write it from scratch. The existing implementation is balls-ugly
 
What has raw pointers?
 
2:54 PM
Lua interpreter
it's written in C so there should be no surprise that it's full of various kinds of junk
 
lulz
I'm not going to rewrite it, I"m looking at an implementation for ARM architecture
 
if I wanted to embed a scripting language, I'd probably go for js. Either that, or write a SML interpreter :)
 
it's written in Standard-compliant ANSI C
there should be no reason to have to re-implement it
 
The original should work on ARM.
 
@jalf Lua's still > JS, IMO
 
2:55 PM
exactly
 
@DeadMG I don't see any reason why
 
I want embeddable Factor VM. :<
 
whats js? JavaScript
 
JS is a nice language. Lua is... silly
 
@jalf Dynamic typing isn't so bad when there's only 8 types.
 
2:56 PM
@TonyTheLion yeah
 
and Lua has way less crappy type coercions
no semicolon insertion
that kind of thing
 
meh I refused to learn javascript so far
 
@DeadMG but why bother embedding a dynamic language if you don't want a useful one?
 
but there seem to be nice libs
 
Lua's pretty useful
 
2:56 PM
like tree.js
 
@Nils JS is nice. As long as you don't run it in a browser
 
I thought JavaScript was web specific
but perhaps it's not
 
The browser DOM is painful regardless of language
@TonyTheLion not at all. It's just a scripting language. But it's traditionally been used mostly for web stuff
 
@TonyTheLion It's dominantly used for that, but it's not strictly tied. You can embed JS into other things for other reasons.
 
2:57 PM
It's just a language.
 
@TonyTheLion there's serverside JS - node.js is popular
 
node.js is pretty sweet, tbh
 
I'm writing an app in NodeJS right now, and it's definitely not scripting.
 
dunno where that name "node" in node.js came from
it has nothing to do with nodes, afaik
 
IMO, the distinction between scripting and non-scripting is dumb
either you can achieve what you want, or you can't
 
2:59 PM
@CatPlusPlus that should be feasible. IIRC factor can call native code via C interface. So... make it do callbacks and you're on your way. I'm not well-versed in factor so I can't do it, but I feel tempted to nonetheless
 
I'd rather be playing with Erlang than JavaScript, but it's bearable.
 
@jalf What is the point of JS if it does not run in a browser?
 
@sehe AFAIK the VM on factorcode is designed to mostly run by itself, not as part of something bigger.
 
@Nils Dunno. What's the point of Python or C++?
 
Is it possible to do using namespace inside of an alias?
 
3:00 PM
It's just a programming language
 
yeah but then you can use something else
 
it was popularized by web browsers, but if I had to pick a good dynamic language, JS would be it
 
@jalf +1
 
JS neatly fills a niche
 
@Pubby Why would you want to do using namespace, and what alias?
 
3:00 PM
It's kind of Lisp with a more C-like syntax.
 
JS has some questionable design choices.
 
@jalf Funny, cause I usually put JS at the bottom of the dynamic language heap
 
Well I am sceptic because of semicolon insertion and stuff, but so far I only used JS for few AJAX things.
 
@DeadMG yeah but that's because you hate dynamic languages
 
Very questionable. Like non-enforced function signatures.
 
3:01 PM
Lua's not that bad
 
@jalf What does it make lisp like?
 
so this Factor language looks rather odd
 
@CatPlusPlus I don't want to qualify stuff inside the alias if that makes sense. I want using foo = ns::bar to just be`using foo = bar`
 
@jalf That just puts all dynamic languages below all static languages, it doesn't dictate their ordering within the heap
 
@Nils well, don't get me wrong, JS has some terrible flaws (just like C++). But if you're careful to stay away from those, the rest is pretty useful and powerful (just like C++)
@DeadMG sure it does. "less dynamic > more dynamic"
 
3:02 PM
Or this, which has horribly weird semantics.
 
hence your preference for Lua :)
 
what makes you think Lua is less dynamic?
 
It's hard to stay away from this, and binding every callback is tiresome.
@Pubby What difference does it make? You'll be using foo::x instead of ns::bar::x anyway.
 
7 mins ago, by DeadMG
@jalf Dynamic typing isn't so bad when there's only 8 types.
 
ok @jalf Well maybe I need to read something about javascript at some point
 
3:03 PM
that's not really an accurate comparison
 
that, pretty much. You like it because it's so small and limited that you don't have to deal with the dynamic stuff much
 
@CatPlusPlus The alias might have 10+ identifiers in it. I think I'll just add an extra struct and alias to the struct.
 
the Lua table is also an object of every type, and an associative array, and a regular array
 
@Pubby Write some real code, I can't see what you mean.
 
plus, you can expose arbitrary new types from the C interface
 
3:04 PM
anyway, I think we've already established that you prefer different languages than me. That's fine, you can use the languages you like. :)
 
I just prefer it because the table design I feel is much more flexible and natural than JS's arrays and objects and ... design, which uses several constructs to achieve the same thing
 
In JS objects and maps are the same, too.
 
Lua even has (limited) operator overloading
 
@Nils take a look at youtube.com/watch?v=hQVTIJBZook, for example
 
Only regular arrays are not, because honestly, it doesn't really make sense otherwise.
 
3:06 PM
eh
for languages like JS and Lua, regular arrays really are an implementation detail
 
Um, no.
 
the advantages that make T[N] worth it, compared to std::unordered_map<int, T>, in C++ don't really exist in that domain
 
@DeadMG .... not really
 
@CatPlusPlus Here's some code. See how the namespace is a problem?
 
Well, you could do namespace name_detail { using namespace mpsl; MPSL_DEFINE_WORD(name, foo, bar, baz, qux); } using name_detail::name;
Or possibly collapse that to that macro.
Or modify the macro to transform __VA_ARGS__ by prepending mpsl:: to each one.
 
user784668
3:09 PM
@CatPlusPlus Is this possible?
 
Wait, will adding namespace name_detail work in non-namespace scope?
 
meh, didn't know there was reverse polish notation
Reverse Polish notation (RPN) is a mathematical notation wherein every operator follows all of its operands, in contrast to Polish notation, which puts the operator in the prefix position. It is also known as Postfix notation and is parenthesis-free as long as operator arities are fixed. The description "Polish" refers to the nationality of logician Jan Łukasiewicz, who invented (prefix) Polish notation in the 1920s. The Reverse Polish scheme was proposed in 1954 by Burks, Warren, and Wright and was independently reinvented by F. L. Bauer and E. W. Dijkstra in the early 1960s to reduce co...
 
@Fanael Sure. #define MPSL_DEFINE_WORD(name, ...) exec<BOOST_PP_SEQ_FOR_EACH(IMPL_PREPEND_MPSL, _, BOOST_PP_TUPLE_TO_SEQ(IMPL_VAR_ARG_COUNT(__VA_ARGS__), (__VA_ARGS__)))>
 
#ifndef api_check #define api_check(L, o) /*{ assert(o); }*/ #endif <-- what does this do?
 
Might write something more complete later, but that's the gist.
Boost.PP is awesome.
@TonyTheLion Really?
 
3:15 PM
it seems this doesn't really do anything?
 
@TonyTheLion Defines a macro that expands to nothing if it's not already defined.
 
funny things, macros
 
sbi
@awoodland Wow, interesting. I had dropped into the meta chat tavern and asked there, but nobody seemed interested, so I moved on.
 
Primitive as hell. If only it was real functional language, without the silly restrictions.
 
hmmm I don't really fully get macros yet
 
3:17 PM
@TonyTheLion there are a lot of such macros
 
#define foo f() really just calls f right?
 
yep
 
Macros manipulate text, not code.
 
Macros are textually expanded with some bonuses. That's it.
 
but how do the arguments on macros work, they don't have types
 
3:18 PM
They don't have to have types.
 
#define bar(x) x + x
 
Well, they have a type — text.
 
is that a valid macro?
lol
 
Yes. It's as if you took every occurence of bar(x) in the code and replaced it with x + x.
It really doesn't do anything else.
Compiler works on already preprocessed code.
 
ah ok
yea
 
3:22 PM
@TonyTheLion Given that 1 << 8 == 256, what do you think bar(1<<8) will evaluate to?
 
@FredOverflow that's mean
 
No, macros are.
 
Everybody has to learn eventually ;)
 
No, ## is.
 
@FredOverflow 256 + 256
 
3:23 PM
Nope.
 
user784668
@TonyTheLion Wrong.
 
but I'm guessing that was too obvious, so it's wrong
 
Our survey says:
 
1<<8 + 1<<8
 
@TonyTheLion Wong, + has higher precedence than <<.
Macros are stupid text replacement.
You almost always want to parenthesize defensively.
 
3:24 PM
so 1<< (8+1) <<8
 
#define bar(x) (x) + (x)
 
user784668
@TonyTheLion: okay, level 2: what do you think bar(i++) will evaluate into?
 
meh, I don't know the precedence of operator++ over operator+
 
It doesn't matter, you'll get undefined behavior.
 
I don't like tests :(
 
3:25 PM
@TonyTheLion meh is a damn good answer to that
 
i++ + i++ is UB
 
right
yes, sequence points
 
whats a good ide for c++
 
@JohnMerlino platform?
 
user784668
@TonyTheLion: level 3: implement bar in a safe way.
 
3:27 PM
#define lua_unlock (L) ((void) 0) <--- this also expands to nothing right?
 
osx lion
 
@TonyTheLion Yes.
 
@JohnMerlino xcode is perfectly reasonable
 
@Fanael clueless I am
 
nice I already have it
 
user784668
3:28 PM
@TonyTheLion It evaluates to an expression of type void.
 
This is the kind of bar you actually want:
 
@DeadMG so what's the point of having it then?
 
template<typename T>
auto bar(const T& x) -> decltype(x + x)
{
    return x + x;
}
 
presumably because in some other interface or implementation, it defines to do something
 
ohhh, decltype :)
I like this decltype thing
 
3:29 PM
decltype is essential for easy expression of many templates
 
/*
** macros for thread synchronization inside Lua core machine:
** all accesses to the global state and to global objects are synchronized.
** Because threads can read the stack of other threads
** (when running garbage collection),
** a thread must also synchronize any write-access to its own stack.
** Unsynchronized accesses are allowed only when reading its own stack,
** or when reading immutable fields from global objects
** (such as string values and udata values).
*/
#ifndef lua_lock
#define lua_lock(L)     ((void) 0)
this does not look very safe to me, I mean, I see no evidence of thread synch
 
you guys use github for source control for code that sits on server?
 
Lua does not have hardware thread support
 
0
Q: Purpose of lua_lock and lua_unlock?

anonWhat is the point of lua_lock and lua_unlock? The following implies it's important: LUA_API void lua_gettable (lua_State *L, int idx) { StkId t; lua_lock(L); t = index2adr(L, idx); api_checkvalidindex(L, t); luaV_gettable(L, t, L->top - 1, L->top - 1); lua_unlock(L); } LUA_A...

here's the answer
 
when it says "thread", it means co-routines
 
user784668
3:37 PM
Oh no.
 
3
A: Why does cout prevent subsequent code from running here?

RobAdd these #includes: #include <sys/types.h> #include <sys/wait.h> then invoke wait(2) correctly: int status; wait(&status); After that fixes the problem, here are the lessons you should learn: Never, ever, ever say using namespace std;. The direct cause of your problem her...

> Never, ever, ever say using namespace std;
win!
 
> include/annex/concept_check.hpp|33 col 53| internal compiler error: Segmentation fault
 
Crashing compilers suck, especially when there is nothing wrong with your code.
 
sbi
There is no code wrong enough to excuse that the compiler crashes.
 
agree
 
3:48 PM
I think the problem stems from some VVTT abuse. (But I'm not diagnosing right now.)
There is cosmic humour here in that I usually advocate against the use of template template parameters.
 
wouldn't want to be a compiler writer
difficult to get right, I guess
 
user784668
@TonyTheLion More boring than difficult.
 
@FredOverflow wow - a chaos of comments on that one
 
@Fanael Nah, not boring. Just difficult.
 
The fact that string literals are a second-class citizen in the meta-programming world of C++ makes it painful to properly use static_assert as an error reporting tool.
 
3:50 PM
compilers are not so easy to implement I think, just look at the parser alone, damn
language grammar, meh
 
user784668
@daknøk No, a compiler is just a glorified tree transformer, writing them is simply tedious.
 
user784668
@TonyTheLion What language are you talking about? Parsers usually are quite easy to write. Especially if you can use parser generators.
 
I had a hard time unit-testing some C++ code (integrating too many parts), so I redid a big chunk of the equivalent calculation in R to compare results - the R code was TINY in comparison - functional languages are just so concise!
 
ah, well, I'm not that experienced. I just read up on a language parrsers and language grammer definitions, looked complicated
but perhaps it's easier than it looks
 
unfortunately, the R results are different than the C++ results so it'll be more debugging for me tomorrow morning...
 
3:54 PM
@TonyTheLion it's more difficult than it looks. Writing parsers seems simple, but it's really hard.
 
right, well it seems that the concept of hard and easy are fairly relative from person to person
 
user784668
@daknøk If you mean constructing LR state machine by hand, then I agree. But there are more sane and simpler ways to create a parser.
 
now, do things like Lua need a language grammar?
 
@Fanael like using lex and yacc?
 
user784668
@daknøk These tools are ancient, but yes, using them is a possibility.
 
4:00 PM
@TonyTheLion Yes, of course it does.
I believe that Lua has an LL grammar
 
user784668
@DeadMG I doubt it's a property of a language itself. You know, C++ is parsed fine by both Clang (with a recursive-descent parser) and Elsa (with a GLR parser).
 
@Fanael Some grammars are simply not LL.
in some cases you can get away with it with left-factoring and parser extensions
but not all
whereas I think that Lua is strictly LL
 
Bob
When doing test driven development, do you start with the view layer code or do you start at the model layer? MVC
Or in general
Do you always start with your domain
 
user784668
@DeadMG Yeah, right. But I mean that while some grammar may not be LL, all (?) LL grammars can be made LR, so applying that term to a language that can be parsed using whatever method as long as it works is not really meaningul.
 
4:12 PM
TDD and MVC have nothing to do with each other
@Fanael But it is meaningful to say that it isn't LL.
 
user784668
@DeadMG Yes, but you said it is :P
 
Bob
I did not say it did either did I, I only asked if you would start with your model or view layer when doing TDD
 
yeah, so you aren't forced to use LR to deal with it?
sounds like it has meaning to me
 
0
Q: What is the push_back method used for in OpenGL?

user1189296What is the purpose of the push_back method in OpenGL? I was trying to understand a obj model loader program, specifically the following code: while(!in.eof()) { in.getline(buf,256); //dosyanýn sonunda deðilken, coord vektörü // için herþeyi okur. Bir string o...

> Hm, new std::string? Why would anyone want a std::vector<std::string*>?
 
what does the 1 refer to when talking about LL(1) parsers?
 
user784668
4:26 PM
@TonyTheLion Number of tokens of lookahead.
 
I've got a quick question.
 
user784668
@daknøk Cool.
 
Can I tell Premake to prefer clang over GCC?
 
@FredOverflow given that we don't actually know the type of coord isn't that NARQ?
it could be some local thing
 
but highly unlikely
given it's position as a common method on a Standard container, assuming std::vector<std::string*> or something similar would be perfectly reasonable
 
4:34 PM
Hi everyone!
Why is the following bit of code giving me an error
 
T.MAX isn't right
T::MAX
T is a type, not an instance
 
Thanks :)
 
user784668
Could someone answer a question of mine? I didn't get a real answer and I'm really curious about that.
 
sure
(terms and conditions apply)
Which question?
 
user784668
6
Q: Difference between `T&` and `const T&` for all-const class

FanaelSuppose that I have a class like that: class Foo : boost::noncopyable { public: Foo(int a, int b); const int something; const int something_else; const std::string another_field; // and that's that, no more methods nor fields }; Now, is there any practical difference between accessi...

 
4:42 PM
@Fanael: The most important thing here (imho) is not what you can and cannot do with the object, but what you want to do with the object in the current scope
If you do not want to change it, make it const, even if it doesn't matter now, it could maybe matter in the future and introduce nasty bugs if you don't add the const qualifier
 
@Fanael I'd say the answer is that the compiler can do whatever it likes with either form if the observable behaviour is correct. So a) is the observable behaviour different between the two? Not that I know of and b) is one more amenable to optimisations? Possibly, hard to say with certainty though
 
user784668
@KillianDS Yeah, const-correctness, I'm aware of that.
 
I don't have a neat quote for "not that I know of" though which I'd want to find to answer it
 
user784668
@KillianDS This is not a question about what should be done, but rather about what can be done. If it weren't the case, I wouldn't tag it with .
 
@Fanael: so what do you want to know, if there is any usage of the object that would give a compilation/runtime error with const T& and not with T& (or vice-versa)?
 
user784668
4:48 PM
@KillianDS Yeah, or different behavior.
 
"Yo dawg i herd u liek entropy so we put some energy n ur isolated system and now we can't get it back out. =\"
@Fanael you can't pass a const T to a function expecting a mutable T
If you already have the reference then what you can do with them is the same, except for which functions you can pass it too.
 
user784668
@MooingDuck Well, that's obviously true.
 
user784668
Is it the only difference?
 
@Fanael it's the only thing I can think of, and the same thing the only answer thought of.
 
user784668
@MooingDuck The only answer is more about temporaries.
 
4:55 PM
@Fanael ah, can't pass a temporary to a function expecting a mutable ref. You're right, that is slightly different
 
is MS's __declspec similar to __attribute__ in GCC?
 

« first day (486 days earlier)      last day (4452 days later) »