|
hackbunny posted:like, a compile-time ast api boost sprint now i am forever sullied
|
# ? Mar 10, 2015 00:54 |
|
|
# ? Jun 3, 2024 01:38 |
|
hackbunny posted:like, a compile-time ast api have you heard of our lord and savior, martin odersky?
|
# ? Mar 10, 2015 00:56 |
|
Brain Candy posted:boost sprint spirit?
|
# ? Mar 10, 2015 01:00 |
|
those would be the right letters
|
# ? Mar 10, 2015 01:01 |
|
bobbilljim posted:where are your stored / parametrized queries??? I use x-macros to build the static parts, ie the list of columns, the list of parameter placeholders, and the list of binding parameters themselves. the schema is stupid simple and I would have been happy with the babbiest of babby orms but bb10 doesn't have even that, so half-handwritten half-autogenerated queries it is. I paste together some string literals, some x-macros expanding to other string literals, and I get queries that might be handwritten clean as they are so goddamn happy to be finally using c++ at work objective c is alright, java is fine and groovy is tolerable, but man. c++ in production eternal job security Brain Candy posted:boost sprint I mean an api into the compiler's ast, to generate code at compile time in a type-safe way. type-safe macros. using (x-)macros makes you write code like this: C++ code:
Dessert Rose posted:use a lisp and every time I bring up type-safe macros/compile time data this is what they tell me
|
# ? Mar 10, 2015 01:13 |
|
to be actually useful, there should be another api that works at the semantic level, where you can query symbol tables, type definitions etc. it will never ever happen e: I did see a proposal for a low-level reflection primitive in c++ that was basically compile-time introspection hackbunny fucked around with this message at 01:21 on Mar 10, 2015 |
# ? Mar 10, 2015 01:18 |
|
boost proto somebody tried it http://icai.ektf.hu/pdf/ICAI2010-vol2-pp383-390.pdf
|
# ? Mar 10, 2015 01:22 |
|
it just lacks the analog warmness of token-pasting
|
# ? Mar 10, 2015 01:25 |
|
bobbilljim posted:where are your stored / parametrized queries??? Use MemSQL, no support for stored proc or prepared statements, but parameterized queries are there. In MemSQL queries are translated into source code and fed into GCC.
|
# ? Mar 10, 2015 01:36 |
|
cutesy sql wrappers including orms tend to get useless when you need nested queries or grouped queries, god help you if you need both the most important query in our model (fills the data in the very first page of the UI) is SQL code:
(rereading it now it seems it could return more than one result for each unique key, if they have identical timestamps. goddamn) MrMoo posted:Use MemSQL, no support for stored proc or prepared statements, but parameterized queries are there. In MemSQL queries are translated into source code and fed into GCC. sure, let's add a caboose to the qcc mantrain
|
# ? Mar 10, 2015 01:39 |
|
please use stored procs
|
# ? Mar 10, 2015 04:41 |
|
hackbunny posted:cutesy sql wrappers including orms tend to get useless when you need nested queries or grouped queries, god help you if you need both i hope the fartboners are a direct copy and paste
|
# ? Mar 10, 2015 05:09 |
|
gonadic io posted:reminder: 90% of these are a normal haskell function with: resurrecting this bad post from page 3 to remind you that printf is loving terrible and should die
|
# ? Mar 10, 2015 18:51 |
|
hackbunny posted:cutesy sql wrappers including orms tend to get useless when you need nested queries or grouped queries, god help you if you need both this query would be easy to do in hibernate, and probably more readable. bad ORMs exist but not all ORMs are bad because you touched activerecord once
|
# ? Mar 10, 2015 18:53 |
|
Notorious b.s.d. posted:this query would be easy to do in hibernate, and probably more readable. bad ORMs exist but not all ORMs are bad because you touched activerecord once what was hibernate's reasoning for making a query language almost like sql but not really? just to gently caress with everyone who first thought they could write straight sql?
|
# ? Mar 10, 2015 19:07 |
|
Notorious b.s.d. posted:resurrecting this bad post from page 3 to remind you that printf is loving terrible and should die reminder that nbsd's proposed replacement was c++ iostreams but without the operator overloads, because localisation doesn't matter I guess
|
# ? Mar 10, 2015 19:11 |
|
Notorious b.s.d. posted:this query would be easy to do in hibernate, and probably more readable. bad ORMs exist but not all ORMs are bad because you touched activerecord once more like activerecord touched me
|
# ? Mar 10, 2015 19:34 |
|
all orms are bad use statement mappers and procs
|
# ? Mar 10, 2015 19:35 |
|
iBatis was and is pretty simple to use and useful which explains why it never really took off. people just love loving around with poo poo like hibernate endlessly instead of just using something simpler and moving on with their lives.
|
# ? Mar 10, 2015 19:57 |
|
MeruFM posted:what was hibernate's reasoning for making a query language almost like sql but not really? hibernate tried to be all things to all people, and some people are stupid. i always preferred the criteria interface Java code:
|
# ? Mar 10, 2015 20:01 |
|
Soricidus posted:reminder that nbsd's proposed replacement was c++ iostreams but without the operator overloads, because localisation doesn't matter I guess you could keep the string templating for localization purposes, but abandon the dumb and totally un-type-checked dsl for formatting the bits inside the template would just be names for the parameters, and you could have type safety on the named arguments. so the compiler can know if the thing about to be formatted as a float actually is a float Notorious b.s.d. fucked around with this message at 20:04 on Mar 10, 2015 |
# ? Mar 10, 2015 20:01 |
|
Notorious b.s.d. posted:you could keep the string templating for localization purposes, but abandon the dumb and totally un-type-checked dsl for formatting cool, and how exactly do i set the number of significant digits on that float
|
# ? Mar 10, 2015 20:20 |
|
Notorious b.s.d. posted:you could keep the string templating for localization purposes, but abandon the dumb and totally un-type-checked dsl for formattin this is pretty disingenuous btw, every c compiler for a thousand ages has given warnings if the types in your format string don't match the types of the actual arguments provided
|
# ? Mar 10, 2015 20:23 |
|
Dessert Rose posted:cool, and how exactly do i set the number of significant digits on that float with a typechecked class or function whose sole purpose is to format floats, instead of bashing it into a mega-subroutine like printf Notorious b.s.d. fucked around with this message at 21:19 on Mar 10, 2015 |
# ? Mar 10, 2015 21:16 |
|
Blotto Skorzany posted:this is pretty disingenuous btw, every c compiler for a thousand ages has given warnings if the types in your format string don't match the types of the actual arguments provided so you are telling me bugs relating to the lack of typechecking in printf are so common and troublesome that compilers have special handling specifically for printf? great language design there, guys
|
# ? Mar 10, 2015 21:18 |
|
Wasn't someone suggesting printf strings were the only reasonable way of sending data to logger because otherwise you have to perform an operation per variable to concatenate it? nm it was shaggar http://forums.somethingawful.com/showthread.php?threadid=3548182&pagenumber=322&perpage=40#post442140978
|
# ? Mar 10, 2015 21:27 |
|
c# string formatting is different from c printf
|
# ? Mar 10, 2015 21:43 |
|
fwiw i quite agree that the printf we have today is deeply flawed. but the basic concept of string templates using a dsl to specify formats is good and convenient and likely to be more readable than any alternative, and in languages that are insufficently powerful to handle typechecking that in a library, it is sensible for the compiler to special-case that typechecking.
|
# ? Mar 10, 2015 21:56 |
|
compiler should see into the logging code and sink the computation of the logging string below the is-enabled test
|
# ? Mar 10, 2015 21:57 |
|
Soricidus posted:fwiw i quite agree that the printf we have today is deeply flawed. but the basic concept of string templates using a dsl to specify formats is good and convenient and likely to be more readable than any alternative, and in languages that are insufficently powerful to handle typechecking that in a library, it is sensible for the compiler to special-case that typechecking. yeah i guess this is where we disagree. i find the dsl for formatting to be really, really terrible. it's so hard to remember, i have to look up the specific format every time. if i wrote format strings all day every day, that would probably stop. but i don't. it's optimizing for the wrong case. code should be easy to read, being easy to write is totally optional the lack of typechecking and lovely compiler warnings are just consequences of the bad design
|
# ? Mar 10, 2015 22:02 |
|
Notorious b.s.d. posted:yeah i guess this is where we disagree. i find the dsl for formatting to be really, really terrible. it's so hard to remember, i have to look up the specific format every time. if i wrote format strings all day every day, that would probably stop. but i don't. it's optimizing for the wrong case. code should be easy to read, being easy to write is totally optional i'm not even sure we disagree all that much. depends whether you mean the printf dsl specifically, or all dsls period. the printf dsl is bad.
|
# ? Mar 10, 2015 22:20 |
|
Subjunctive posted:compiler should see into the logging code and sink the computation of the logging string below the is-enabled test macros, my friend. macros
|
# ? Mar 10, 2015 23:18 |
|
Notorious b.s.d. posted:it's so hard to remember, i have to look up the specific format every time. if i wrote format strings all day every day, that would probably stop. but i don't. if you write C or C++ code every day, you'll use printf format strings every day. or you are a bad programmer and have no/bad logging in your code
|
# ? Mar 10, 2015 23:23 |
|
if you have a specific suggestion for how to do it better without losing templating, that would be cool. it is not a coincidence that most languages tend to recreate printf at some point, dynamic unsafety and all if you had dynamic type information, you could avoid some of the %f/%g crap, i guess? but now you've introduced dynamic type metadata into the language, good luck with designing that tiny little feature feel free to say "you should completely abandon some basic goals of your language in order to make printf better", but maybe you should recognize that's what you're saying
|
# ? Mar 10, 2015 23:31 |
|
uuh just make it a variadic template and don't encode the type information in the format string? C++11 can do this now, all that's really needed is some sort of std::to_string() convention.
|
# ? Mar 10, 2015 23:33 |
|
ah yes, C++-style variadic templates, a small feature that could have been painlessly added to c in 1980
|
# ? Mar 10, 2015 23:35 |
|
Mr Dog posted:uuh just make it a variadic template and don't encode the type information in the format string? C++11 can do this now, all that's really needed is some sort of std::to_string() convention. this is the kind of thing people tend to come up with, yes. then they realise that you can't simply say "convert all these objects to strings please" because you also need to handle different bases for numbers, different precisions and rounding modes and scientific notation, content-aware padding that might care about lining up things like decimal points, etc etc ... and the formats become more complex, and if you're not careful you're back at printf except instead of a bad syntax that only a few people know, you have a bad syntax that nobody knows.
|
# ? Mar 10, 2015 23:49 |
|
I'm rather fond of Boost.Format but internally it's based on iostreams and that's eugh
|
# ? Mar 11, 2015 00:10 |
|
Notorious b.s.d. posted:this query would be easy to do in hibernate, and probably more readable. bad ORMs exist but not all ORMs are bad because you touched activerecord once you're confusing me with shaggar I think I have used GORM (Grails) and CoreData. CoreData in particular makes complex queries nearly impossible, but then CoreData "is not an ORM". GORM's most common API, the criteria builder DSL, doesn't support subqueries and the alternatives (detached criteria) are horribly documented and poorly integrated. which is par for the course for Grails, visible plumbing and nested layers of dynamic dispatch everywhere
|
# ? Mar 11, 2015 00:31 |
|
|
# ? Jun 3, 2024 01:38 |
I don't really understand all the hate for C++'s streams. Is it just that they are not typechecked or is there more?
|
|
# ? Mar 11, 2015 01:25 |