Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
trealira
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
39 ms
·
661.
▲
by
trealira
3y ago
Then, my bad for misinterpreting what you wrote.
662.
▲
by
trealira
3y ago
I assume it's because they view private industry as a US asset, and don't want Russia or China hacking them (to steal IP, or gather information, etc.). Promoting cyber security in the civilian workforce is also part of the DoD
663.
▲
by
trealira
3y ago
Modern C++ can still be unsafe. I recently wrote a comment about it here: https://news.ycombinator.com/item?id=38576681
664.
▲
by
trealira
3y ago
We'd probably be using Ada. The government used to mandate that contractors write software in Ada, but they stopped because of the pushback they got; now they also use C++.
665.
▲
by
trealira
3y ago
Nvidia uses it: https://blog.adacore.com/nvidia-security-team-what-if-we-jus...
666.
▲
by
trealira
3y ago
You can also cause a segfault in Go by dereferencing a null pointer. That's another example of not being entirely memory safe.
667.
▲
by
trealira
3y ago
My bad, I thought npins was unsigned.
668.
▲
by
trealira
3y ago
You're right. I don't know why, but I didn't realize that neither method of multiplication required you to use more than 2 registers here. The use of a temporary register was probably coincidental. Maybe it wouldn't have
669.
▲
by
trealira
3y ago
I have tried to resize letters in FontForge and realized that the letters looked too small when I got rid of the overshoot. Sorry for the late response. I didn't see your reply.
670.
▲
by
trealira
3y ago
> Sure and containers give you syscall restrictions and OS protections, but you don’t see people embedding containers inside of other applications. It sounds like you're implying that C coders will opt out of the sandboxing provided
671.
▲
by
trealira
3y ago
Have you managed to trigger this? You never ended up explaining how the heap overflow occurs, and I cannot determine whether the other person who was guessing how it might happen is right, because I am not very familiar with OpenBSD's
672.
▲
by
trealira
3y ago
> Then `SYS_kbind` seems to be a signed int. So this comparison will be signed and "fix" the negative `npins` to `SYS_kbind`: npins = MAX(npins, SYS_kbind) No, the comparison is unsigned here. They're integers of th
673.
▲
by
trealira
3y ago
> It's an untyped #define Pure decimal integer literals (like 86) are typed as "int" in C, rather than being typeless and triggering type inference. This is a pain when you accidentally write something like this: uint6
674.
▲
by
trealira
3y ago
Although this isn't about the 6502, this reminds me of how I had to write x86_64 assembly for class, and was trying to use LEA to avoid a multiplication. After I wrote it, I wondered if the compiler did the same thing I did, but it did
675.
▲
by
trealira
3y ago
> heavily optimising compilers a lot less common. Not just that, but the theory that drives modern compilers, like graph coloring register allocation and static single assignment form, weren't conceived until the mid 1980s (1984 and
676.
▲
by
trealira
3y ago
Bob Morgan's book Building an Optimizing Compiler is entirely focused on modern compiler optimizations (and it was published in 1997). It goes over building a control flow graph, various optimizations you can do with that, alias anal
677.
▲
Basics of Compiler Design
(archive.org)
21 points
by
trealira
3y ago
|
1 comments
678.
▲
by
trealira
3y ago
I'm sharing this partly because it seems to be freely available on archive.org. It's also freely shared on the author's website: http://hjemmesider.diku.dk/~torbenm/Basics/index.html This book has a
679.
▲
by
trealira
3y ago
In Lisp, "let" is only used for binding the variable, and it comes with a scope. (let ((a 1) (b 2)) (+ a b)) It's closer to the ML version of let, which works like this: let val a = 1 val b
680.
▲
by
trealira
3y ago
From the response: Much of the criticism of C++ is based on code that is written in older styles, or even in C, that do not use the modern facilities aimed to increase type-and-resource safety. Also, the C++ eco system offers a large numbe
681.
▲
by
trealira
3y ago
For context, this is what they're replying to: https://www.federalregister.gov/documents/2023/08/10/2023-17...
682.
▲
by
trealira
3y ago
I'm not sure if software engineering classes in particular do, but at my university, they teach C++ in the second required course, and they teach you about using GDB and Valgrind on Linux there. They don't explicitly teach you abo
683.
▲
by
trealira
3y ago
I guess you're right. I think of type inference as "there is no pre-set type for a literal; the type is is inferred based on the context it's used in." But that isn't the definition of type inference. The definition
684.
▲
by
trealira
3y ago
> that (1 / 2.0) is a double. That is not type inference. 1 has the type int. 2.0 has the type double. Then, 1 gets converted to double. Then the whole expression has the type double. This isn't type inference; this is like say
685.
▲
by
trealira
3y ago
In C, there's no type inference. Integer literals have the type "int" by default, and they need a suffix to be unsigned or long. They get truncated and promoted implicitly for convenience's sake. /* 'a'
686.
▲
by
trealira
3y ago
I think to make software more reliable, you'd have to go back to the "waterfall" method of development. If we went back to Dijkstra's notion of correctness by construction, then a specification for the program would be m
687.
▲
by
trealira
3y ago
> For that reason, I created a proof-of-concept tool called polyglot that can scan C++ code and generate wrappers for use from Rust and D. That's just as interesting, IMO. I had been expecting some sort of bespoke Makefile that hack
688.
▲
by
trealira
3y ago
There are a few people on Hacker News I recognize, because they're often commenting on the same subjects: for example, pjmlp, lispm, kazinator, Rochus. Other people I recognize because they use their real names and they're famous:
689.
▲
by
trealira
3y ago
Though this is about OCaml, LLVM also does this optimization. From this Reddit post[1], you can see how this gets optimized into an iterative function: size_t my_strlen(const char *s) { return (*s == '\0') ? 0 : 1 + my_s
690.
▲
Tail Modulo Cons [pdf]
(arxiv.org)
5 points
by
trealira
3y ago
|
1 comments
More ›