HNHacker News
TopNewBestAskShowJobs

v8dev123

1 karma · joined April 13, 2021

submissionscomments
v8dev123··on Flashlight: Fast and flexible machine learning in C++
Hmm

Which C++ version you guys are using?

v8dev123··on Are top websites using WebGL for fingerprinting?
Disabling JS does nothing when you can do network level fingerprinting.
v8dev123··on Flashlight: Fast and flexible machine learning in C++
You will see Modern C++ more like Python these days. It has really neat stuff. A comment is not enough to describe this.
v8dev123··on Bjarne Stroustrup: Linus wants attention
Thanks for this. I was looking to post both but turns out I can't.
v8dev123··on Why Rust strings seem hard
You're correct. I don't know why people downvote you. A lot of C++ comments are grayed out. Does HN has an agenda or what?
v8dev123··on Is WebAssembly magic performance pixie dust?
QT is not moving away from pure C++. QT using QML for front end now and for backend you have to use C++.

Please see this commend by Ivan,

https://www.reddit.com/r/cpp/comments/s0mhf/qt_5_moving_away...

> Afterwards go learn how to create a GUI for macOS, iOS, Android, ChromeOS, Windows, WebOS (as shipped by LG) or even Fuchsia, using only their SDKs and nothing else.

Why use native SDK when there is QT?

The same can be said for Java. Why use Swing when there is native SDK?

Ahahhaa

The way you treat C++ is unfair.

v8dev123··on Is WebAssembly magic performance pixie dust?
> low level details leak into your high level description of code, making the two coupled. You can’t make them invisible.

It's your job to make it not to leak. You have to write Modern C++ wrappers around C libs.

Similarity, The same can be said for Java. You can do low level in Java.

C++ is not C. C++ has backward compatibility with C.

Look at Boost folks, they wrote a Modern C++ wrapper around a C HTTP parser.

> And as I said, I’m familiar with RAII, it’s really great when the given object is scope-based, but can’t do anything otherwise.

Nothing is impossible.

You can use Scope Exit Guard with QT Widget.

https://github.com/ricab/scope_guard

> And if the new subclass has some non-standard object life cycle you HAVE to handle that case somewhere else, modifying another aspect of the code. It is not invisible, unless you want leaking code/memory corruption.

Again, Scope Exit Guards solve your problem!

v8dev123··on Coinbase from YC to DPO
Why does title changed from IPO to DPO?
v8dev123··on Why Rust strings seem hard
> understand how computers work

No body understands it even at electron orbitals. Your understanding will be wrong in next decade if not wrong already. Computer Arch is proprietary.

Give a try for C++17.

Zero Cost Abstractions RAII

It's a beast.

v8dev123··on Is WebAssembly magic performance pixie dust?
1. QT is cross platform.

2. QT not moving away from pure C++.

C++ apps always been more responsive than java swing and electron.

v8dev123··on Is WebAssembly magic performance pixie dust?
> A language either cares about low level details or not. You can’t have it both ways. And c++ is absolutely a low level language.

Please tell me why you can't. C++ is both not one. It's a multi paradigm language.

In Modern C++, the low level details invisible.

> Every memory allocation/deallocation have to be thought out again and tested

True If you're writing C with Classes or Java Style C++.

>> C with Classes >>> malloc()

>> Java Style C++ >>> new and delete everywhere

> There are plenty of cases where you can’t really pinpoint a scope-exit where this given object should be reclaimed.

Show me. I'd bet your case can be solved with xvalues.

> A GC is a necessity in many concurrent algorithms that simply could not be written without.

Show me a concurrent algorithm that needs GC.

> but what if the requirement has changed now touching on a core of your program.

C++ is a OOP language just like Java. You do it same way as you do in Java. Use inheritance.

> major refactor as it is another low level lang

No. It's not a low level language if you write Modern C++.

The case for Java very clear prior 2011 but now C++ has caught up.

v8dev123··on Is WebAssembly magic performance pixie dust?
"In 2017, the Qt Company estimated a community of about 1 million developers worldwide[18] in over 70 industries."

See list of companies using C++ QT for GUI,

https://en.wikipedia.org/wiki/Qt_(software)

v8dev123··on Is WebAssembly magic performance pixie dust?
C++ is not just a low level language. It's consists both high level and low level. C however a low level language.

I bench-marked using Intel vTune.

for loop is interesting. It's why Tensorflow Core written in C++ instead Java.

I don't know any complex C++ program that employ their own GCs when C++ has RAII which is superior to GC.

Just give a try for C++11/14/17 and you will see which one is more maintainable and expressive.

Look at Chromium codebase. It's the most beautiful codebase I've ever been to.

I've done a lot of CRUD web apps in C++ using expresscpp [1] and I would say it's easy as ABC.

A lot of Java folks haven't tried C++11/14/17 (Modern C++).

C++ is Zen of OOP.

[1] https://github.com/expresscpp/expresscpp

v8dev123··on Is WebAssembly magic performance pixie dust?
Google where I works at is largely a C++ shop despite Android Java.

AOT compilers exists for Java, Net, Javascript. I however doubt the user experience of those.

For example, GraalVM mentions the following,

"There is a small portion of Java features are not susceptible to ahead-of-time compilation, and will therefore miss out on the performance advantages. To be able to build a highly optimized native executable, GraalVM runs an aggressive static analysis that requires a closed-world assumption, which means that all classes and all bytecodes that are reachable at run time must be known at build time. Therefore, it is not possible to load new data that have not been available during ahead-of-time compilation."

v8dev123··on Is WebAssembly magic performance pixie dust?
You don't have to be an expert to write Fast C++ that beats Java. I wrote a simple for loop and when compiled with -O3 it beat the Java version of it.

You just need to know your tools, that's it. Plenty people forget -O flag and existence of libraries like Folly.

If you combine PGO along with these must knows, you seriously will become much more faster.

v8dev123··on Is WebAssembly magic performance pixie dust?
Are those C++ ones written in pre-C++11 ?

I don't think C++ and Rust are for just low-level. I've build a lot of GUI apps and distributed ones with C++

QT is a beast.

The issue with Java is the reverse engineering. Back in 90's, The main selling point for Java was to prevent it, because at that time the bytecode was hard to understand at least. Now tools has grown and it's fairly easy to reverse engineer Java, even if one obfuscate it.

As for C++, Inline code and template code make it pain in ass.

I'm sure big companies that care about intellectual property would use C++ over Java anytime. C++ also has mature obfuscation tools that make it even more difficult.

Java has it's place. It's great language if you use in server side or isolated env (From commercial viewpoint).

Nevertheless, I've built many web apps using C++ too.

v8dev123··on Is WebAssembly magic performance pixie dust?
You can access DOM and WebAPI using em_val. Emscripten provides the support. WASM doesn't however. It's complicated.
v8dev123··on Chrome zero-day released on GitHub – fixed on V8 but still works on latest
Aaaaaand It's not the first time WASM seen in [0] wild.

[0] https://bugs.chromium.org/p/chromium/issues/detail?id=835887

v8dev123··on Chrome zero-day released on GitHub – fixed on V8 but still works on latest
This bug didn't bypass our sandbox so everything is safe and no need to panic.
← PreviousPage 3 of 3