Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
junke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
41 ms
·
361.
▲
by
junke
10y ago
C was very close to the metal in the earliest versions (PDP-11). Since then, CPU architectures evolved and even though the language evolved too, C compilers somehow have more work to do to map the programmer's intent to the actual hard
362.
▲
by
junke
10y ago
> Otherwise you'll have runtime type errors which would be just as bad as runtime parsing errors. Parsing errors in script shells can easily go unnoticed (until you realize your data is corrupted).
363.
▲
by
junke
10y ago
The example is not really interesting, because as you said there is already a simple structure. But programming with text becomes really tiresome after a while. For example: git blame -L ${LINE},+1 --porcelain ${FILE} | sed -n '&
364.
▲
by
junke
10y ago
Beyond text, structured data can give you actual functions or object instances. You can inspect a path object without dealing with escaped slashes, etc. For example, that's how I understand the "capabilities" security model
365.
▲
by
junke
10y ago
When I submit my application, I generally get a confirmation email ("You have successfully applied"). Some companies say "If you don't hear back from us before two weeks, consider yourself rejected". That is good en
366.
▲
by
junke
10y ago
This depends on the purpose of your function. It is the responsibility of the caller to not assume too much about dependencies, but you should help by being clear about the expected types of your functions. However that doesn't mean yo
367.
▲
by
junke
10y ago
Click on development view, and then you have a tree; for example: Location, Code, Error Handling, Error Conditions, Return Values, Status Codes, Unchecked Return Value ( https://cwe.mitre.org/data/definitions/252.ht
368.
▲
by
junke
10y ago
Use Ada.
369.
▲
by
junke
10y ago
A lot safer than the "Just Run Out" low-tech approach.
370.
▲
by
junke
10y ago
Just a remainder: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-... . Don't rely on first and last names. Also, the age keeps changing, store a date (unless the age is what the user inputs,
371.
▲
by
junke
10y ago
I didn't say it is the best solution in all possible cases. Just that even if you choose not to write Lisp, using a data format that follows Lisp's approach is not a stupid thing to do. > Undervaluing this realization (and wors
372.
▲
by
junke
10y ago
> In other words: once you decide you don't want to program in Lisp, Lisp's way of representing data stops being a useful syntax for representing your data. Even if you code in C++, you can find Lisp's surface syntax simpl
373.
▲
by
junke
10y ago
https://www.reddit.com/r/lisp/comments/d177c/a_critique_of_a... https://www.reddit.com/r/programming/comments/ujj3/a_critiqu... https://www.reddit.com/
374.
▲
by
junke
10y ago
It seems some people would rather die than use parenthesis and acknowledge that those damn lispers had a good idea, after all. When curly braces fall out of fashion, what will come next? I vote for "263D first quarter moon" and
375.
▲
by
junke
10y ago
> Am I crazy to think that maybe other lisps would have done better if they had demanded less purity? People associate Common Lisp with many different things, but not purity.
376.
▲
by
junke
10y ago
If you squint your eyes, it really looks like a cond: (cond ((not (eq (type $) :private)) :public) ((<= 20 (value $) 29) :value-in-twenties) (t :default-state))
377.
▲
by
junke
10y ago
Because Javascript doesn't have macros.
378.
▲
Codebase Refactoring with Go
(talks.golang.org)
232 points
by
junke
10y ago
|
47 comments
379.
▲
by
junke
10y ago
Regarding integer division, the Wikipedia article about modulo operation has nice graphics. https://en.wikipedia.org/wiki/Modulo_operation
380.
▲
by
junke
10y ago
Thanks for the detailed answer.
381.
▲
by
junke
10y ago
For Lisp, SBCL is known for giving optimizations notes: ; note: forced to do GENERIC-+ (cost 10) ; unable to do inline fixnum arithmetic (cost 2) because: ; The first argument is a NUMBER, not a FIXNUM. ;
382.
▲
by
junke
10y ago
Thanks. Isn't it possible to give a "coefficients" vector with large enough values so that computations with 64 bits would overflow too? I don't doubt the code works in practice, because the range of values are reasonabl
383.
▲
by
junke
10y ago
I don't know anything about FLAC, but is the implicit modular arithmetic the expected behavior here? What if a product or a sum overflows?
384.
▲
by
junke
10y ago
Thanks, I clearly didn't get it :-)
385.
▲
by
junke
10y ago
> Edit: I guess even Lisp developers have to consider Unicode. Why wouldn't they?
386.
▲
by
junke
10y ago
My view is that lack of provable safety should be resolved by defensive code (runtime checks). And then, you are safe (if safety is important in your code, which probably should by default in a professional setting).
387.
▲
by
junke
10y ago
There is no doubt that C, by definition, opts out from performing bound checkings. But if bounds were always checked by default (implicitly), then you would have to opt-out explicitly, which is a safer approach, because all else being equ
388.
▲
by
junke
10y ago
I mean something like Ada's pragmas: https://en.wikibooks.org/wiki/Ada_Programming/Pragmas/Suppre...
389.
▲
by
junke
10y ago
You are right, "do not happen" sounds too much like "will never happen". See also Wikipedia's entry about that example[0]. My point is that if the programmer can't prove accesses are always within appropriate b
390.
▲
by
junke
10y ago
Vulnerabilities like buffer overflow do not happen in languages with a string type. Humans are responsible if something bad happens, but without a safety net, the outcome is worse.
More ›