Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
m-ou-se
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
m-ou-se
5y ago
It was stabilized in 2019 by accident: https://twitter.com/m_ou_se/status/1396827152859942921 https://github.com/rust-lang/rust/pull/79270
2.
▲
by
m-ou-se
5y ago
An important one is missing from this overview: using a const. This is sometimes useful, because it does not require the type to be Copy; only that the value is a constant: const EMPTY: String = String::new(); let a: [String; 10
3.
▲
by
m-ou-se
6y ago
SEEKING SPONSOR: I work on the Rust standard library and compiler. As of a few months ago, I'm part of the Rust library team, which is the team that manages everything in and around the standard library. I'm currently working on t
4.
▲
by
m-ou-se
6y ago
`T: 'a` means that you may keep values of type T around for lifetime 'a, but not that they will . So `T: 'static` means that you may keep values of that type around forever, as they do not refer to anything that doesn'
5.
▲
by
m-ou-se
6y ago
Good point! Updated.
6.
▲
by
m-ou-se
6y ago
Thanks! Updated.
7.
▲
by
m-ou-se
6y ago
Imports work fine. The main reason I wrote this, was to be able to use the Python matplotlib library in Rust: https://twitter.com/m_ou_se/status/1120577172438233088
8.
▲
by
m-ou-se
7y ago
It doesn't translate Python to Rust or anything like that, it uses CPython both to compile to Python bytecode and to run it. It doesn't launch a separate interpreter, the interpreter is used as a library, so runs in the same proce
9.
▲
by
m-ou-se
7y ago
It uses the same Python interpreter, but each macro invocation is considered its own module. A later version of the crate will have the possibility to keep the context around to be re-used by a later invocation such that, for example, you d
10.
▲
by
m-ou-se
7y ago
In Python, all data (even simple integers) are all allocated on the heap. ToPyObject makes a deep copy of everything, converting everything to `PyObject` on the heap, so all data is owned. The numpy crate helps if you need to convert large
11.
▲
by
m-ou-se
7y ago
Matplotlib was one of the reasons I made this. Works just fine: https://github.com/dronesforwork/inline-python/blob/aebabc88...
12.
▲
by
m-ou-se
7y ago
At work, we make high performant drone control systems in Rust. But for testing and debugging, we simply use Matplotlib (a Python library) to make plots of simulations, etc. So we prefer Rust for the control systems themselves for the speed
13.
▲
by
m-ou-se
7y ago
Author here. Let me know if you have any questions. :)
14.
▲
Show HN: Inline Python – Rust macro to write Python directly in Rust source code
(docs.rs)
7 points
by
m-ou-se
7y ago
|
0 comments
15.
▲
by
m-ou-se
7y ago
Yes, this was our main worry as well. At first we switched to Rust only for the lower level code, the parts that interfaces with sensors and the motors, that do the data logging, our inter process communication library, etc. The part with t
16.
▲
by
m-ou-se
7y ago
We do, but it's very minimal for now: https://dronesforwork.nl/ We'll be changing our company name in a few weeks, followed by the launch of a new website which should have a lot more information than the current
17.
▲
by
m-ou-se
7y ago
Yes! I'm founder of a start-up (about 10 employees now) that makes flight controllers for Drones, and all the software that runs on them is written in Rust. We don't use STM chips though. Since the way we do state estimation and f
18.
▲
Gmail Introduces DRM for Email
(support.google.com)
3 points
by
m-ou-se
8y ago
|
0 comments
19.
▲
by
m-ou-se
8y ago
C does not have a modulo operator. It has a remainder operator, which works perfectly fine. Calling C's `%` a 'broken modulo operator' is like calling `+` a 'broken minus operator'. Quite a few languages have separa
20.
▲
by
m-ou-se
8y ago
They have duck.com and ddg.gg. Both Firefox and Chromium make <ctrl-enter> wrap the url in 'www.' and '.com', so 'duck<ctrl-enter>' works.
21.
▲
by
m-ou-se
8y ago
All of the first challenge's puzzles can be solved with: .thing { background: url(data:image/png;base64,iVBO...); width: ...px; height: ...px; } Where the image data is just the target image itself.
22.
▲
The Finkbeiner Test: A Tool for Writing About Women in their Professions
(lastwordonnothing.com)
45 points
by
m-ou-se
8y ago
|
60 comments
23.
▲
by
m-ou-se
8y ago
Note: It's not a paywall. Simply click 'Eerst verder lezen' to read the full article.
24.
▲
Fitness app gives anyone names+address for 1000s of soldiers and secret agents
(decorrespondent.nl)
3 points
by
m-ou-se
8y ago
|
1 comments
25.
▲
by
m-ou-se
9y ago
> basically all the symbols you can find on a keyboard C++ doesn't even use @ and $, yet ;)
26.
▲
by
m-ou-se
9y ago
Some do. More are active on Reddit. But new proposals can come from anyone. Though, before writing and submitting any, check on the public std-proposals mailinglist if your idea would get any traction. See https://isocpp.org/
27.
▲
by
m-ou-se
9y ago
You can build the pdf yourself from the LaTeX source: https://github.com/cplusplus/draft Or get the latest public draft from https://wg21.link/standard Or an html version: http://eelis.net&#
28.
▲
by
m-ou-se
9y ago
C++ already had syntax for pulling out one member by name: ;) const auto x = f().x1;
29.
▲
by
m-ou-se
9y ago
Dutch license plates have similar properties. Not by changing the proportions of the letters, but by cutting out parts of letters. For example, the R is missing a piece so you can't make it from a P and some black tape: https:/&#
30.
▲
by
m-ou-se
9y ago
This made me laugh: "His power level is [3000.1]. That's 0.09999999999990905 more than 3000."
More ›