Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pfultz2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
Cget: cmake package retrieval
(github.com)
49 points
by
pfultz2
11y ago
|
24 comments
32.
▲
by
pfultz2
11y ago
> Essentially, the more abstract and generic things are (like Python) And in C++, it provides the same high-level expressiveness as in Python. > the more you can use them to easily do complex things arcoss different domains quickly. B
33.
▲
by
pfultz2
11y ago
> One of the other differences is that Python tends to provide higher levels of abstraction than C/C++ code. So, doing something like a set intersection using x.intersection(y) may not necessarily be the fastest way. C++ provides `s
34.
▲
by
pfultz2
11y ago
`sum_f()` is calling the constructor, not the call operator(which would be `sum_f()(1, 2)`).
35.
▲
by
pfultz2
12y ago
> It is even more likely that the user will use some serialization Serialization is beyond the scope of what I am talking about. I am talking about reading bytes from a serial port. > In that way, when using Async for network sockets,
36.
▲
by
pfultz2
12y ago
Well since Asio is generic there is no coupling between the interface and implementation. However, from a user perspective, they will most likely use both(even its just for sync reading), since Asio provides other utilities such as buffered
37.
▲
by
pfultz2
12y ago
BTW, Asio can be used without needing boost. In fact, the non-boost version is the actual maintained version. A script is applied to boostify it. It would be nice if Asio could be added to biicode.
38.
▲
by
pfultz2
12y ago
> If we had something similar for C and/or C++ before boost was developed, I'd bet we had a SerialPort lib, independent, portable, efficient, focused and well tested, and BoostAsio would just depend on it, instead of developing
39.
▲
C++: Towards better error reporting with Fit and Clang
(pfultz2.com)
3 points
by
pfultz2
12y ago
|
0 comments
40.
▲
by
pfultz2
12y ago
> As a linguist, it is absolutely not an issue of grammar. The grammar is 100% correct. Nit-picking over the so-called "correct" definition has nothing to do with grammar. This is true. Sentences without correct grammar are unp
41.
▲
Docker stores username/passwords in essentially plaintext
(github.com)
4 points
by
pfultz2
12y ago
|
0 comments
42.
▲
by
pfultz2
12y ago
Actually using [ZLang]( https://github.com/pfultz2/ZLang ), you could define them like this: #define IOD_DEFINE_SYMBOL(name) iod_define_symbol(name, _##name) #define IOD_S(name) s::_##name #define ZLANG_io
43.
▲
C++ Reflection in under 100 lines of code
(pfultz2.com)
1 points
by
pfultz2
12y ago
|
0 comments
44.
▲
by
pfultz2
12y ago
Thats cool. Here's the somewhat equivalent in C++: struct square { int x; }; struct rectangle { int x; int y; }; boost::variant<square, rectangle> to_shape(int x, int y)
45.
▲
by
pfultz2
12y ago
I don't know about that link, but in general you would use a fix point combinator. The Fit library has a fix point combinator here: http://pfultz2.github.io/Fit/doc/html/fix/ So you could implement
46.
▲
Alexandrescu speaks up on the infamous “static if considered” paper
(forum.dlang.org)
2 points
by
pfultz2
12y ago
|
0 comments
47.
▲
by
pfultz2
12y ago
Actually, it should be written more like this: template<typename T> std::pair<T, std::vector<std::string_view>> tokenize_string(T &&str); So then it uses `std::forward` to conditionally move the st
48.
▲
by
pfultz2
12y ago
> It is possible to implement it in C++, but the implementation winds up being ridiculously complicated. It may be more verbose in C++, but its not more complicated, and its definitely not "ridiculously" complicated. > I jus
49.
▲
by
pfultz2
12y ago
> To me, the first is much easier to read, but perhaps my mind has been warped by functional programming languages. Actually, pipable is very similiar to haskell's `$` function. So a similiar thing is done to improve readability of
50.
▲
by
pfultz2
12y ago
> The issue with extending operators in this fashion is that you're violating the principle of least surprise. It is really common for the `|` operator to be used for piping functions together. There are several libraries that suppo
51.
▲
by
pfultz2
12y ago
> You can write good C++ that more or less resembles Java That doesn't sound like good C++. Making everything a pointer or implementing polymorphism through pointers makes the code harder to reason about, and makes tighter coupling
52.
▲
by
pfultz2
12y ago
I disagree. It makes it very simple to make a pipable function, you just wrap the function object in pipable. There's nothing complicated about using it. Futhermore, doing it by hand is not as simple, but still not very complicated. Th
53.
▲
by
pfultz2
12y ago
In practice, I've yet to see a problem.
54.
▲
by
pfultz2
12y ago
How is it self-evident?
55.
▲
by
pfultz2
12y ago
Well this can help when you have many nested functions that are chained together, for example, like this: auto r = select(where(numbers, [](int x) { return x > 2; }), [](int x) { return x * x; }); Because of nesting this can be
56.
▲
by
pfultz2
12y ago
There is a library in C++ called Web Transaction Framework(WTF): https://github.com/belzano/WTF
57.
▲
by
pfultz2
12y ago
You should check out metashell then: https://github.com/sabel83/metashell
58.
▲
by
pfultz2
12y ago
This can already be done using Linq in C++, which is range-based rather than iterator based: auto q = LINQ( from(z, boost::irange(1, std::numerical_limits<int>::max())) from(x, boost::irange(1, z)
59.
▲
by
pfultz2
12y ago
Or using [Linq]( https://github.com/pfultz2/Linq ): vector<int> squareVec(const vector<int>& v) { return LINQ(from(i, v) select(i*i)) | linq::to_container; } And also filtering ou
60.
▲
by
pfultz2
13y ago
> Type-level meta programming is still confined to using templates though... Which there is less of need for this, since we have better type deduction in C++11 and 14 as well.
More ›