As some of you are aware there were a lot of changes
the last weeks in rust-core:
https://github.com/deltachat/deltachat-core-rust/pulse/monthly
Thanks to everybody who contributed and of course most to @dignifiedquire
who kick-started and guides the crazy efforts on April 26th, 2019 now
known as rust core or DCC-RS sometimes.
However, master is currently less stable than it was beginning June -- i guess
that 4e41dbf5ab0bf23de57ea6c0841b50047b382ff0 was still quite stable FYI.
On Master there are bugs like "E2E-encryption unavailable unexpectedly" (#233) and
incoming messages appearing corrupted (#223). At the same time, it's not easy
to debug those as there still is a lot of hard-to-read code that stems from
the original C2Rust translation. Here is an example of a merged PR that
removes some of those "goto" reminescences:
https://github.com/deltachat/deltachat-core-rust/pull/229
The idea here and probably with many other commits is to *separate functional changes
from re-indentation changes* to allow precise review. It's very easy to introduce
logical bugs if no one can properly compared "before/after". Cleanup PRs typically
should come in a Two-Commit form: one commit changing only logic (minimize indentation changes)
and one only doing "cargo fmt". You typically only review the first commit
and trust that the committer really did nothing else than "cargo fmt" in
the second. Cleanup PRs can be easily done by Rust-newcomers and they
greatly help readability and debuggability of everything. Here is
the current count of unsafe/free/goto usages in core:
dc_tools.rs unsafe: 91 free: 59 goto-blocks: 4
dc_msg.rs unsafe: 60 free: 38 goto-blocks: 3
dc_chat.rs unsafe: 70 free: 30 goto-blocks: 0
dc_imex.rs unsafe: 14 free: 30 goto-blocks: 48
dc_configure.rs unsafe: 15 free: 20 goto-blocks: 38
dc_contact.rs unsafe: 51 free: 19 goto-blocks: 0
dc_mimeparser.rs unsafe: 29 free: 29 goto-blocks: 12
dc_job.rs unsafe: 28 free: 11 goto-blocks: 29
dc_receive_imf.rs unsafe: 16 free: 22 goto-blocks: 19
dc_securejoin.rs unsafe: 13 free: 14 goto-blocks: 29
...
...
total unsafe: 653
total free: 436
total gotoblocks: 234
Note that the latter total is down ~20% compared to June 8/4e41dbf5ab0bf23de57ea6c0841b50047b382ff0:
total unsafe: 768
total free: 565
total gotoblocks: 294
The list can be obtained by executing "python top_level_evil.py" in the src dir.
It'd be good to accelerate this cleanup-by-cleanup effort in order to help overall stability
and readability. You may look at the "dc_*.c" counterpart file in
https://github.com/deltachat/deltachat-core/tree/master/src
if editing a rust-file -- often there are also comments which are good to transfer.
Floris' note made sense to me here: "it probably will get worse before it gets better".
As long as we have tons of unsafe/safe boundaries, changing some of them
can easily corrupt others.
There also are deeper cleanup-PRs like the past sqlite, strbuilder ones or the current
https://github.com/deltachat/deltachat-core-rust/pull/211 (dc_array as Rust vector)
https://github.com/deltachat/deltachat-core-rust/pull/188 (new stock strings API)
Such cleanup-PRs require more Rust-knowledge already but also have a much deeper
pleasurable effect ;) I btw recommend all rust-beginners to watch the repo
and follow PRs and comments. Lots of little things to learn there ;)
There are some more ideas on larger scale cleanups (requiring deeper knowledge), eg:
- remove all usage of char* path-handling code contained in dc_tools.rs
with rust Path usage. This also removes a lot of alloc/free code in
many places.
- encasuplate (and finally) replace "mmime" (the mime-parser C2Rust translated
from libetpan) such that core code (dc_mimeparser as consumer and producer
of APIs) does not leak C-pointers left and right and forces one to use
"carray" or "clist" in regular core-rust vectors. I gues that
Friedel/@dignifiedquire and Bjoern/@r10s might have more refined
ideas on how this could be done.
- please tell ;)
Lastly, i mentioned the Rust-sprint idea but i am myself not available
in August and first half september there already is a UX/DC gathering
which focuses strongly on UX issues, so not good to mix with rust-core.
It seems likely that in the week of Sept 23-30th several folks
interested in DC and/or Rust will hang out in Freiburg/DE to do hack
sessions and discussions around rust-core together. Also the-compiler
and me intend to use 2 days in that week to advance DC chat bots and
maybe start a PyQT-based DC client for added fun. If anyone wants
to join but lacks money to make the travel, please mail me.
On a related side note Bjoern and Richy are continuing to focus
on getting a major reworked "Delta/iOS" version out soon (tm).
Delta/iOS uses rust-core so fixing the aforementioned bug-showstoppers
remains a priority as well. Also, OAUTH2 is not working again yet (#119).
I think i am not the only one looking very much forward to having
rust-core become stable and nice :) It is the single basis for all DC apps and
will allow many interesting new feature and UX developments ... on which
several of us also want to engage in 2019 ... For one, there are the longer standing
issues from our Cuban friends who need better control over data/server-storage
usage ... but also needs from people who need alternatives when Signal,
Whatsapp or other centralised services are blocked ... which happens and
threatens to happen in many places these days.
so much for now, keep up all the good work and thanks for any help!
holger (who is mostly afk in August)
P.S.: subscription to mailing list:
https://lists.codespeak.net/postorius/lists/delta.codespeak.net/
chatting with folks: #deltachat on freenode
hi all,
there is the idea to convene in Freiburg/DE for some rust-hacking days
on Delta Chat core, the library that is used by all Delta Chat apps and
OX/COI apps, as well as chat bot code. https://github.com/deltachat/deltachat-core-rust
If you are interested to help out and learn/deepen your Rust and
get involved with DCC core, please send me a private mail (at best
from Delta Chat). This way you'd be included in arranging timing.
Feel free to send this on to friends as well.
We'll also be getting more funding from the OpenTechFund for 2019/2020
so if you are looking for receiving some money and helping DC developments
we'd be happy to find arrangements! To begin with, we can provide travel funding
and accomodation when you join a gathering. Note that several of the core contributors
to Delta Chat are also newbies to Rust, and there are a lot of different things to
do for different levels of expertise.
cheers,
holger
Hi all,
there is a new python bindings release for the deltachat core library.
Main news: it's based on the experimental deltachat-core in Rust.
On Linux you can simply issue "pip install deltachat" without
any prior steps. More docs and install instructions here:
https://py.delta.chat
If you want to help with lots of cleanup work,
and learn Rust by doing that, be our guest and checkout
https://github.com/deltachat/deltachat-core-rust/
You can find and chat with developers on #deltachat freenode.
cheers
holger
Changelog 0.600.0
-----------------
- use new experimental full-Rust Delta Chat core
- support Autocrypt Setup Messages
- remove synchronous events
- use CircleCI for continous integration and packaging of Linux wheels
- use docker image for building wheels
- fix code documentation links
there are new desktop releases, for the first time on all platforms:
https://delta.chat/en/2019-06-25-desktop
windows is experimental, the other platforms should be quite stable
and well usable.
thanks to the many people who made all the desktop
releases possible, a good part of who you can find here:
https://github.com/deltachat/deltachat-desktop/graphs/contributorshttps://github.com/deltachat/deltachat-node/graphs/contributors
note that the node bindings come in pre-built form now,
npm name is "deltachat-node". There is no compile-step
involved anymore and these bindings are uniformly using
the experimental rust core:
https://www.npmjs.com/package/deltachat-node
note that DC core-rust (sometimes "dcc-rs") has some known issues
but will become the new official core lib for Delta Chat
real soon now (tm). If you are interested in Rust coding
or can help others doing so, please drop by at the rust repo! :)
cheers,
holger
Hi,
I'm Marko from Germany. Just trying the DeltaChat Client with SailfishX and elementary OS 5.0
On elementary I get a error message after the npm start. Anyone the same problem here?
--M.
--
Gesendet mit SailfishX
hi all,
as last week the sync was partly in real-life and not really on IRC,
there is another real-IRC sync meeting this week:
Tomorrow, Wednesday, June 5th, 15:00 CEST (Berlin)
on IRC #deltachat on freenode
topics will probably be:
1. LAST/NEXT/BLOCKERS
2. ongoing efforts in porting the core to rust
3. status of desktop
4. status of ios
5. status of android
6. misc
we'll try to limit the meeting to 30~45 minutes.
it makes sense for everyone who attends to prepare LAST/NEXT/BLOCKERS
text fragments: LAST is what you worked on since you last appeared on a
sync. NEXT is what you are up to. BLOCKERS are issues or questions
complicating making NEXT harder.
best
bjoern
hi all,
in case someone has missed the note in the irc-topic,
there is another sync-meeting
Today, Wednesday, May 22nd, 15:00 CEST (Berlin) on #deltachat
topics will probably be mainly the release status on the various platforms.
a summary of the last sync-meeting is available at
https://cryptpad.fr/code/#/2/code/edit/k5aqEnpYROwtEMsLxco8Yb1G/ -
thanks rtn :)
best
bjoern
this time around #deltachat syncing takes place
Wednesday, May 15th, 3pm CEST
on #deltachat.
prepare your last/next/blocker lines.
Topics will likely be:
- state of core-rust
- state of node-bindings, desktop releasing
- android and iOS highlights
- reviewing/helping with OTF2 proposal submission (due in the evening)
cheers,
holger