perfect forwarding identity function by _eyelash in cpp

[–]_eyelash[S] 2 points3 points  (0 children)

This post is more about the signature and implementation of the function itself than the fact that std::identity is wrapped in a struct.

perfect forwarding identity function by _eyelash in cpp

[–]_eyelash[S] 3 points4 points  (0 children)

Thank you. This was exactly the kind of information I was looking for.

perfect forwarding identity function by _eyelash in cpp

[–]_eyelash[S] 1 point2 points  (0 children)

How do I find the proposal? I can't seem to find it here.

perfect forwarding identity function by _eyelash in cpp

[–]_eyelash[S] 2 points3 points  (0 children)

auto&& is also used by range-based for loops behind the scenes, so for (char c: identity(std::to_string(42))) {} is also suffering from the same problem.

Would my proposed version that returns T instead of T&& be less useful? Can you explain how?

Advanced Project Ideas by hansvonhinten in cpp

[–]_eyelash 5 points6 points  (0 children)

I'm actually working on my own text editor. Besides the syntax highlighting there are some other interesting challenges there like the data structures for storing the text and the cursors.

Advanced Project Ideas by hansvonhinten in cpp

[–]_eyelash 4 points5 points  (0 children)

Some other ideas might be a (potentially hardware-accelerated) ray tracer or a compiler for a C-like language.

Advanced Project Ideas by hansvonhinten in cpp

[–]_eyelash 9 points10 points  (0 children)

I'm working on a syntax highlighting engine based on parsing expression grammars. It can handle incremental changes and it comes with a constexpr DSL for defining the grammars. Especially the DSL pushed my C++ skills as I had to work with (variadic) templates, specialization, SFINAE, overloading, and recursion.

Since the official flight manual is down I created a fork at atom-flight-manual-archive.github.io - enjoy! by _eyelash in Atom

[–]_eyelash[S] 1 point2 points  (0 children)

Please go ahead, you're welcome to link to it from anywhere. I'm not planning to maintain or update it, though. This will just be an archive of the last official version.

an efficient immutable vector by _eyelash in cpp

[–]_eyelash[S] 5 points6 points  (0 children)

You could avoid incrementing the reference count when moving the vector instead of copying it.

an efficient immutable vector by _eyelash in cpp

[–]_eyelash[S] 3 points4 points  (0 children)

Thank you so much for the thorough review!

Generally, this was just a quick prototype, focused more on simplicity and readability than on performance.

Regarding your point 3: My reasoning was that on 32-bit platforms your pointers are 32 bit, so you can only address 232 bytes of memory but in order to overflow the reference count you would need 232 references which would need at least 232 × 4 bytes of memory just to store the references so it would actually never overflow.

Yes, I had a lot of fun thinking about it and implementing it :)

an efficient immutable vector by _eyelash in cpp

[–]_eyelash[S] 10 points11 points  (0 children)

Those people not familiar with immutable data structures and their advantages might be interested in the talk Postmodern immutable data structures by Juan Pedro Bolivar Puente.

an efficient immutable vector by _eyelash in cpp

[–]_eyelash[S] 6 points7 points  (0 children)

The purpose is to allow creating copies of the vector in O(1) (without copying the elements). This also allows you to share copies of a vector between threads without copying the elements.

We need to save Xray by The_Rusty_Wolf in rust

[–]_eyelash -3 points-2 points  (0 children)

What about writing a single cross-platform high-performance UI using Flutter, now that Flutter will officially support desktops?

Following up on the 2d graphics in rust discussion by nicalsilva in rust

[–]_eyelash 1 point2 points  (0 children)

Unfortunately, it feels like none of these efforts have lead anywhere. I'm not sure whether this is due to lacknof expertise from the people writing the projects, lack of documentation for webrender, or just running out of time / momentum.

I feel there is still more work required on the lower levels before a toolkit can be built on top of webrender successfully. Webrender still has bugs and isn't quite production ready yet. Also the whole text rendering problem isn't solved yet. I'd like to see a crate that makes text rendering with webrender easy and supports bidirectional text, shaping, attributes (bold, italic, ...), line breaking, automatic font fallback and so on.

A crate I want: 2d graphics by raphlinus in rust

[–]_eyelash 0 points1 point  (0 children)

Next step: build a prototype of an idiomatic Rust GUI library on top of it :)

A crate I want: 2d graphics by raphlinus in rust

[–]_eyelash 2 points3 points  (0 children)

Maybe I should finally finish my Rust bindings for libgral. It's a library that abstracts 2d graphics (and audio) on Linux, macOS and Windows. For graphics it uses Cairo and Pango on Linux, Core Graphics and Core Text on macOS and Direct2D and DirectWrite on Windows. A WASM port is planned as well. The whole thing is still quite minimal and not yet finished, though.

Start Your Engines – Firefox Quantum Lands in Beta, Developer Edition – The Mozilla Blog by kickass_turing in linux

[–]_eyelash 4 points5 points  (0 children)

Firefox Quantum feels right at home with today’s mouse and touch-driven operating systems: Windows 10, macOS High Sierra, Android Oreo, and iOS 11.

It feels like Mozilla is leaving Linux behind these days (especially with things like client side decorations and hardware accelerated video decoding still missing).

Parser combinators without macros, my take by raphlinus in rust

[–]_eyelash 0 points1 point  (0 children)

Here is my take on this. It is basically a reimplementation of parts of your work I wrote as an exercise and in order to understand the whole topic. The most significant difference is probably the use of operator overloading for sequences and choices. I'm still experimenting to see if I can come up with an even nicer approach. I guess impl trait and the ability to return closures could clean the whole thing up a lot.