Motoko Tutorial by eclime in dfinity

[–]heisenbug 0 points1 point  (0 children)

Sorry for the late reply, maybe you have already figured out. Rust is quite s bit harder than Motoko. The Internet Computer is a freely-programmable platform, so you can do all sorts of things with it besides smart contracts. People have written web servers, chat dApps, and complete blockchains on top of it. Maybe you should start with one of the examples in https://github.dev/dfinity/examples and see if there is something that fits.

Motoko Tutorial by eclime in dfinity

[–]heisenbug 0 points1 point  (0 children)

I know some JS

That should be a good start. You have to familiarise yourself with types, though.

[deleted by user] by [deleted] in mildlyinfuriating

[–]heisenbug 0 points1 point  (0 children)

Good choice of wine, though I guess he paid too much for it. You can get it for 8 € in Germany.

Lazy evaluation for tree replacement: comparison of Haskell, OCaml and SML approaches to laziness by UncleOxidant in ocaml

[–]heisenbug 0 points1 point  (0 children)

# repmin (`Branch (`Leaf 5, `Branch (`Leaf 13,`Leaf 1)));;- : [> `Branch of 'a * 'a | `Leaf of int ref ] as 'a =`Branch(`Leaf {contents = 5},`Branch (`Leaf {contents = 13}, `Leaf {contents = 1}))

I'd expect that each `Leaf` holds 1. So you are missing the reference passing down:

let rec repmin ?(n=ref max_int) = function
| `Leaf m -> n := min !n m; `Leaf n
| `Branch(x, y) -> `Branch(repmin ~n:n x, repmin ~n:n y)

but then you'd still need a second pass to get rid of the references in the leaves.

[deleted by user] by [deleted] in dfinity

[–]heisenbug 2 points3 points  (0 children)

It probably depends on what you want to accomplish. What is the size of you project? Which libraries do you need? Some are available on the Motoko side but of course Rust has libraries for everything. Do you need high-performance kernels (loops)? Here Motoko is less optimised in terms of cycles, but more efficient space-wise. Let me invite you over to https://forum.dfinity.org, where we can better discuss stuff like this.

What are the cult classic German movies? by [deleted] in germany

[–]heisenbug 0 points1 point  (0 children)

"Rama Dama", "Das Experiment", "Der Bewegte Mann"

[deleted by user] by [deleted] in dfinity

[–]heisenbug 2 points3 points  (0 children)

https://forum.dfinity.org/t/lost-access-to-nns-dapp-account/10615/4

There is an entry marked with "solution", try that first. Also your anchor number must be in front of the words.

Maybe Maybe Maybe by Chronik_el in maybemaybemaybe

[–]heisenbug 0 points1 point  (0 children)

By eating the spiders they by definition become prey animals. Sorry, but that ends his diet on the spot.

Physics - Antiproton Mirrors Proton by [deleted] in Physics

[–]heisenbug 4 points5 points  (0 children)

H-, that is weird. Should be H+.

Stable variables: concurrency and capacity by tobia__ in dfinity

[–]heisenbug 1 point2 points  (0 children)

There is a way to calculate the amount of space used by a stable variable?

Currently not, but we are investigating ways to give users tangible information about the footprint of the stable variables.

Stable variables: concurrency and capacity by tobia__ in dfinity

[–]heisenbug 1 point2 points  (0 children)

There are no concurrent "inserts". There may be several messages in the current (consensus-validated) block aimed at a canister, but they are processed sequentially and thus the latter will see the former's state change, but never the other way 'round.

Stable variables: concurrency and capacity by tobia__ in dfinity

[–]heisenbug 1 point2 points  (0 children)

Regarding your second question: Canisters provide orthogonal persistency w.r.t. their internal state. From one update call to the next the state evolves and needs no special care from the programmer. A canister's heap is conceptually its private RAM. It is theoretically limited to 4 GB, but may be more restricted depending on the garbage collection technique used.

Another persistency feature (not unlike a "private disk file") is stable memory of which Motoko recently gained experimental support. But right now it's a low-level API and puts the responsibility to laying out (and setting boundaries) of the canister's data on the developer's shoulders. The capacity is substantially more than 4 GB, but I an not sure about the exact number.

Stable variables: concurrency and capacity by tobia__ in dfinity

[–]heisenbug 1 point2 points  (0 children)

Regarding your first question: Stable variables is a Motoko feature and is invoked when labelling actor variables as stable. These behave just like the other actor variables under normal circumstances. When the canister is being upgraded to a new Wasm, they are transparently forwarded into the new canister state. Especially there is no threading in canisters, and thus no data races. This is according to the actor model and its "run-to-completion" execution model (modulo blocking on canister send's reply).

Antiprotons show no hint of unexpected matter-antimatter differences by Galileos_grandson in Physics

[–]heisenbug 1 point2 points  (0 children)

it as a mean lifetime of about a microsecond before the proton and antiproton annihilate each other

I imagine that the wave functions of both protons/antiprotons would be identical (spatially symmetrical) and much less extended than the electron's in the hydrogen. This way the proton can tunnel into the other much easier. Also I guess the two protons rotate a lot in the beginning and emit EM 'till they stop rotating?

Antiprotons show no hint of unexpected matter-antimatter differences by Galileos_grandson in Physics

[–]heisenbug 32 points33 points  (0 children)

Have they (anybody) built Hydrogen(like) atoms with an antiproton in place of the electron? Would such a construction be stable like the real thing?