37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
I read an [article](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003/) recently that described an attempted back door in the Linux kernel and it got me thinking about language safety.
|
|
|
|
First I tested beloved Rust:
|
|
|
|
`cargo run`
|
|
```
|
|
error[E0308]: mismatched types
|
|
--> src/main.rs:3:8
|
|
|
|
|
3 | if ligma = 4 {
|
|
| ^^^^^^^^^ expected `bool`, found `()`
|
|
|
|
|
help: you might have meant to compare for equality
|
|
|
|
|
3 | if ligma == 4 {
|
|
| +
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|
|
error: could not compile `linux_03_backdoor_test` (bin "linux_03_backdoor_test") due to 1 previous error
|
|
```
|
|
of course it threw a fit.
|
|
|
|
Next up is Python:
|
|
`python test.py`
|
|
```
|
|
if ligma = 4:
|
|
" Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$ │ ^^^^^^^^^
|
|
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:special │SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
|
|
```
|
|
Python caught it.
|
|
|
|
Next, JavaScript:
|
|
`node test.js`
|
|
```
|
|
4
|
|
```
|
|
This is why I hate JS.
|