News for hackers. Stuff that matters.

hackthesystem

Re:How to Build an Evil Compiler on Monday April 18, 2022 @06:56PM (#31077727)
It's possible to make a compiler backdoor that is "updatable" and therefore a lot less brittle. And yes this does make the backdoor easier to detect since it's now communicating over the network. But such flexibility could really future-proof the backdoor and let it evolve over time as the target language changes.
Re:How to Build an Evil Compiler on Monday April 18, 2022 @06:52PM (#31077689)
Who said it has to "generalize"? No virus generalizes to hack every program. That doesn't mean viruses aren't dangerous.

Also OSS makes up most of the modern stack, so access to source code is a given. And hand-crafting a backdoor when you have the source code is trivial because you can literally change anything you want with confidence.

Re:Exploring SIMD performance improvements in WebAssembly (2021) on Wednesday February 02, 2022 @06:48PM (#30186066)
Thanks for mentioning, I just updated my website and Github to use the new WAT functions.
Re:Exploring SIMD performance improvements in WebAssembly (2021) on Wednesday February 02, 2022 @05:54PM (#30185319)
I actually tried comparing 128-bit SIMD to the 64-bit performance and the difference was 2x. I only published the results for the 4x comparison, but it should be pretty easy to reproduce if you change the types in the non-SIMD code[1] from i32 -> i64.

[1] https://github.com/awelm/simd-wasm-profiling/blob/master/fil...

Re:Exploring SIMD performance improvements in WebAssembly (2021) on Wednesday February 02, 2022 @03:53PM (#30183923)
Thanks! Good points, I think in general the fixed-width "packed" SIMD ISAs have the downsides that you mentioned.

But it seems that WebAssembly doesn't have length-agnostic SIMD instructions yet. There is an open proposal to add this though: https://github.com/WebAssembly/flexible-vectors

Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @05:46PM (#30170667)
Great questions! I'm not a database expert either but I can try answering these:

1) I think databases like to manage pages directly because the db can make more optimizations than the OS because the db has more context. For example, when aborting a transaction the db knows its dirty pages should be evicted (i'm not sure if mmap offers custom eviction). Also I believe if the db uses mmap, it loses control over when pages are flushed to disk. Flush control is necessary for guaranteeing transaction durability.

2) What you're describing here sounds similar to a LSM-tree database (e.g. RocksDB). They are used often for write-heavy workloads because writes are just appends, but they might not be great for read-heavy things.

3) This reminds me of PRQL[1] (which was trending on Hacker News last week) and Spark SQL. I'm not too familiar with this area though, so I can't really say why SQL was designed this way.

[1] https://github.com/max-sixty/prql?utm_source=hackernewslette...

Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @12:22PM (#30165867)
Good point. I just removed my name from the license, but I couldn't find the original author(s) so the copyright name list is just empty now
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @11:50AM (#30165304)
There is also BusTub from CMU which I stumbled upon earlier today:

https://github.com/cmu-db/bustub

Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @11:45AM (#30165201)
Yeah, I think its a shame that most teachers don't give assignments like this that tie the big picture together with the low-level details. After students complete a big assignment like SimpleDB, they'll have a working artifact that they can reference for the rest of their career
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @11:28AM (#30164862)
When I was implementing SimpleDB in 2019, I believe CMU's course didn't have resources and lab assignments that were publicly available. Now CMU has published a full video lecture series (which MIT doesn't have) and their labs. So if I were starting again today, I would probably go with CMU's course.

CMU Intro to Databases Labs: https://15445.courses.cs.cmu.edu/fall2021/assignments.html

CMU Intro to Databases Lectures: https://www.youtube.com/playlist?list=PLSE8ODhjZXjZaHA6QcxDf...

BusTub - CMU's Version of SimpleDB: https://github.com/cmu-db/bustub

Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @01:56AM (#30159425)
Thanks! I'd also like to see a MVCC implementation because that would shed some light on how mysql works. I'll add MVCC to the future improvements section
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @01:42AM (#30159352)
Thanks, really glad to hear that!
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @01:41AM (#30159345)
Ah yes, by the time I realized this it was too late to rename unfortunately. And very neat how Amazon SimpleDB is written in Erlang!
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @12:18AM (#30158910)
Thank you! I'll be sure to check out the book
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @12:14AM (#30158889)
Thanks! I do plan on adding indexes soon
Re:SimpleDB: A Basic RDBMS Built from Scratch on Tuesday February 01, 2022 @12:11AM (#30158876)
I think that is the recommended approach, but I just read the lecture notes and started working on the assignments. I tried to prioritize coding because it helps me retain knowledge better over time
Re:SimpleDB: A Basic RDBMS Built from Scratch on Monday January 31, 2022 @11:58PM (#30158793)
Thanks! Just added the MIT license