Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fafhrd91
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
fafhrd91
9y ago
tokio-minihttp is 1 in plaintext benchmark in TechEmpower Web frameworks benchmark https://www.techempower.com/benchmarks/#section=data-r15&hw=...
32.
▲
by
fafhrd91
9y ago
https://github.com/PyO3/pyo3 Rust/Python is very good
33.
▲
by
fafhrd91
9y ago
Pyo3 is not affected by this issue. pyo3 compiles in c-api interface, it doesn't use separate libs for that (python27-sys)
34.
▲
by
fafhrd91
9y ago
My point is, you are not limited with using extensions only for optimizing hot loops, in rust you can write application logic as well. I doubt you should do this in C for example
35.
▲
by
fafhrd91
9y ago
Python extension doesn’t mean C. Rust works perfectly for extensions, it covers a lot of low level c-api integration and it is fast. You can write whole application in rust and use python as a glue language https://github.com
36.
▲
by
fafhrd91
9y ago
Good client library https://github.com/seanmonstar/reqwest Could be used as async or as sync. Http/2 client and server https://github.com/carllerche/h2 Web framework https://githu
37.
▲
by
fafhrd91
9y ago
There is PyO3 library https://github.com/PyO3/pyo3
38.
▲
H2 (Tokio based HTTP/2.0 client and server) is released to crates.io
(reddit.com)
3 points
by
fafhrd91
9y ago
|
0 comments
39.
▲
by
fafhrd91
9y ago
https://github.com/actix/actix-web
40.
▲
Announcing Actix web 0.3 – A small, fast, pragmatic, async rust web framework
6 points
by
fafhrd91
9y ago
|
1 comments
41.
▲
by
fafhrd91
9y ago
I am building async web framework with http/2 and websockets support. I think rust is great! You can write high level code, but if you need to you can always access low level system https://github.com/actix/actix-w
42.
▲
Rust web frameworks benchmarks
(github.com)
3 points
by
fafhrd91
9y ago
|
0 comments
43.
▲
by
fafhrd91
9y ago
Pyo3 support both. You can expose rust to python, and would look to python as native functions and classes or you can call python code from rust Pyo3 uses rust refs ownership to enforce proper Gil usage. You code won’t compile if you use Gi
44.
▲
by
fafhrd91
9y ago
Sure, coupes is fine if do not need to write anything and ctypes is enough. But as soon as you need to make c to python bridge it safer to do in rust. Pyo3 handles ref counting and Gil management for you
45.
▲
by
fafhrd91
9y ago
why not rust? much simpler and safer with libs like https://github.com/PyO3/pyo3
46.
▲
Show HN: SockJS server written in Rust language
(github.com)
7 points
by
fafhrd91
9y ago
|
0 comments
47.
▲
by
fafhrd91
9y ago
you have two options: PyObject and Py<PyList>. Both has Send + Sync and all pyo3 types defines `std::convert::From<T>` for both.
48.
▲
by
fafhrd91
9y ago
not really. it is an alternative to C and cython for extension development.
49.
▲
by
fafhrd91
9y ago
this binding can be used both ways. check first example in readme. and https://github.com/PyO3/pyo3/blob/master/src/python.rs#L203
50.
▲
by
fafhrd91
9y ago
I also wrote asyncio event loop, based on tokio-rs, using this binding. So it is possible to write complex python extensions in Rust. https://github.com/PyO3/tokio
51.
▲
by
fafhrd91
9y ago
sorry about not waiting longer. I didn't want to fork. as for leaking refs, it maybe be fixed by introducing nested "Pool" objects. objective-c runtime has similar concepts and same problem with long running loops.
52.
▲
by
fafhrd91
9y ago
PyO3 is close to first release.
53.
▲
by
fafhrd91
9y ago
what is good about asyncio, it allows to replace default event loop. I am working on asyncio event loop based on tokio-rs (rust). it could bridge asyncio with code written in rust. so potentially, it should be possible to mix python and rus
54.
▲
by
fafhrd91
9y ago
check Sanic code, it loads whole incoming payload into memory before processing it. event for 404, so I can write very simple script that would consume all memory. and you can not really protect sanic service with proxy (nginx)
55.
▲
by
fafhrd91
9y ago
problem with Sanic that it does not implement streaming properly. so it is very easy to kill any Sanic process, 10-20 seconds. again any.
56.
▲
by
fafhrd91
13y ago
it becomes more interesting when you start read streaming server request and then pipe into streaming client request. `yield from` and asyncio makes everything much more simple.
57.
▲
by
fafhrd91
14y ago
Potentially it is slower than tulip, It does magic stack slicing. also it works only on X86 cpu.