Programming Showoffs Thread
-
In response to:
@Dreikin said in Programming Confessions Thread:
@masonwheeler said in Programming Confessions Thread:
Confession #1: When the language I was building my game engine in didn't have features I needed, I wrote a transpiler to convert everything to a new language. It worked surprisingly well, but for some reason
while
loops are completely broken: it places everything until the end of the method within thewhile
loop body! I've never found what's causing that bug.Confession #2: When the new language didn't have a feature I needed (
async/await
), I grabbed Microsoft's C# implementation from the Roslyn sources and spent about half a year rewriting the compiler to add it in and make it all work.I don't think this was meant to be the thread about showing off.
But I got nothin', so on to you, random commentor.
-
I once made a thing that did stuff
-
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
And someone gave me money for making the thing!
-
@boomzilla said in Programming Showoffs Thread:
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
And someone gave me money for making the thing!
So, your wife paid you?
-
@Rhywden said in Programming Showoffs Thread:
@boomzilla said in Programming Showoffs Thread:
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
And someone gave me money for making the thing!
So, your wife paid you?
Not with money.
-
@Rhywden said in Programming Showoffs Thread:
@boomzilla said in Programming Showoffs Thread:
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
And someone gave me money for making the thing!
So, your wife paid you?
Well, yes, she gave me my allowance, but that was for mowing the lawn.
-
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
I once made a thing that did stuff.
I was told to stop doing that.
-
I've made some fancy template metaprograms in the past. For example, you can give me a list of types and I can give you a set with duplicates removed: https://github.com/LB--/tuples/blob/tuples/src/tuple_prune.hpp
I actually only made it because I needed it to gather a list of all classes in a hierarchy with multiple inheritance allowed.
-
@LB_ said in Programming Showoffs Thread:
I've made some fancy template metaprograms in the past.
That belongs on the programming confession program, but there is no forgiveness for someone that writes template metaprograms anyway.
-
@LB_ said in Programming Showoffs Thread:
template metaprograms
Oh cool, I've always wanted to take a look at a simple example of one of those!
…maybe I should take C++ off my resume…
-
I'm writing (with a friend) an optimizing compiler for a language widely reckoned to be typeless. We're getting speeds close to native C and C++ in some cases, so that's nice.
-
@wharrgarbl said in Programming Showoffs Thread:
there is no forgiveness for someone that writes template metaprograms anyway
*pshaw*
If your C++-LOC to x86-asm instruction ratio falls below 20:1, you're not metaprogramming hard enough.
-
@boomzilla said in Programming Showoffs Thread:
@RaceProUK said in Programming Showoffs Thread:
I once made a thing that did stuff
And someone gave me money for making the thing!
And then they later gave me extra money to fix things that weren't working quite like they were supposed to.
-
@LB_ I understand how it works, but it would have taken me ages to write it myself.
-
@LB_ said in Programming Showoffs Thread:
I've made some fancy template metaprograms in the past. For example, you can give me a list of types and I can give you a set with duplicates removed: https://github.com/LB--/tuples/blob/tuples/src/tuple_prune.hpp
I actually only made it because I needed it to gather a list of all classes in a hierarchy with multiple inheritance allowed.
Couldn't you use
__cpp_lib_bool_constant
in tuple_contains.hpp to check for the existence ofstd::bool_constant
?
-
@Dreikin said in Programming Showoffs Thread:
@LB_ said in Programming Showoffs Thread:
template metaprograms
Oh cool, I've always wanted to take a look at a simple example of one of those!
…maybe I should take C++ off my resume…
To be fair, the syntax is awful and it's only possible to use functional programming paradigms, so it's a pretty different way of thinking from normal C++ code.
@djls45 said in Programming Showoffs Thread:
@LB_ said in Programming Showoffs Thread:
I've made some fancy template metaprograms in the past. For example, you can give me a list of types and I can give you a set with duplicates removed: https://github.com/LB--/tuples/blob/tuples/src/tuple_prune.hpp
I actually only made it because I needed it to gather a list of all classes in a hierarchy with multiple inheritance allowed.
Couldn't you use
__cpp_lib_bool_constant
in tuple_contains.hpp to check for the existence ofstd::bool_constant
?I could, but at the time I think one or more of my compilers didn't support feature tests. Also it would make the code messier just for the sake of conditionally using an alias.
-
@LB_ said in Programming Showoffs Thread:
@Dreikin said in Programming Showoffs Thread:
@LB_ said in Programming Showoffs Thread:
template metaprograms
Oh cool, I've always wanted to take a look at a simple example of one of those!
…maybe I should take C++ off my resume…
To be fair, the syntax is awful and it's only possible to use functional programming paradigms, so it's a pretty different way of thinking from normal C++ code.
Well, C++11 added support for stateful metaprogramming, so if you're not good with functional paradigms, it gives you some options.
-
@Gąska What do you mean? I don't think there is yet a stateful way to store a type, possibly change it, and then use it later as the return type of a function.
-
-
I wrote a CPU in VHDL.
And a brainfuck interpreter in CASIO BASIC.
-
@Gąska that's frightening. The
decltype
example alone breaks an assumption I had.
-
@Gąska said in Programming Showoffs Thread:
@LB_ http://b.atch.se/posts/non-constant-constant-expressions/
TIL. Friends really are special in C++.
-
@cvi said in Programming Showoffs Thread:
@Gąska said in Programming Showoffs Thread:
@LB_ http://b.atch.se/posts/non-constant-constant-expressions/
TIL. Friends really are special in C++.
I hear they've got lots of benefits, although you might be hard-pressed finding them.
-
...
-
@wharrgarbl said in Programming Showoffs Thread:
I wrote some viruses
Let me guess ... It deletes stuff
-
@Luhmann possibly ate some cookies occasionally before deleting stuff and leaving behind only a tiny file whose contents are 'This file was deleted.'
-
@dkf is it based in trinary?
-
This post is deleted!
-
@CHUDbert No. Strings. We are definitely somewhat crazy…
(And I really hope I never need to look at another profiler trace of LLVM including the word
computeKnownBits
while wondering WTF is slaughtering my compiler performance. We're not writing C++, so atomising functions to keep down the number of basic blocks being analysed isn't practical at all. :sigh: Fingers crossed that there won't be any major recurrences of the problem with 3.* which turned even cheap optimisation algorithms into memory-hungry monsters.)
-
@Gąska said in [Programming Showoffs Thread](/post
TIL. Friends really are special in C++.
@Dreikin said in Programming Showoffs Thread:
I hear they've got lots of benefits, although you might be hard-pressed finding them.
They can touch each other's private parts.
It beats touching your parent's private parts. That's not allowed.
-
-
@ben_lubar
The Programming Confessions thread is .