We have events in Solidity/EVM, but we have no way of processing them on-chain. All we have is callbacks, explicitly invoked by the SC triggering an event, adding to the cost of the original transaction sender. If you, as a third party, wish to intercept these events and process them on-chain, you still require an off-chain application to mediate.

Hereby, I propose a solution for a simple network built atop of Ethereum. At this stage, it is merely a concept, and feedback is greatly appreciated.

Concept

Clients, most likely Smart Contract developers, register a subscription with the network. Part of such…


Organizing your code in modules helps maintain a clear structure by separation of concerns. Furthermore, modularized code can be reused either wholly or partly in other projects. Today, I learned the arguably most important aspect of import is how it behaves internally and how that affects the size of your Smart Contract.

The documentation itself merely hints at it: when importing a module you bring all or certain symbols from its global namespace into yours. This even includes nested imports. When you import a contract which itself imports Open Zeppelin’s IERC20 interface, then your source module will also know IERC20.


AsyncIO is one of the techniques you’ll never want to give up again! It simplifies asynchronous coding dramatically. If you’ve come from JavaScript, you will be accustom to the async/await syntax. But you may be confused how to kick it all off. We’ll go through the most fundamental concepts here.

The Usage

First and foremost, what does it do and how do I use it? AsyncIO employs the so-called Event Loop which, in essence, is a single-threaded built-in scheduler. As long as any task is still running/waiting on the event loop, your program won’t terminate naturally. We won’t go into detail here…


This paragraph either demonstrates a fundamental misunderstanding of the tech on the Author's side, or a haphazardly lazy presentation of facts.

Just because the altcoins are "faster" & have lower energy consumption & transaction fees doesn't make them "better". Or safer. Or more popular. In fact, many of these alternative blockchains face the serious issue of rendering average users unable to run a full node themselves. Just look at Solana's recommended system specs. You literally need to invest in a modern gaming PC to run a full node. …


Personally, I found UnionAll to be a rather difficult topic — though primarily due to its namely similarity to the much simpler Union type. But once the differences are clear, it’s flexibility and power become apparent.

Decorative image of a stylized Union.
Decorative image of a stylized Union.
Graphic © by 100%Open

UnionAll is used in a single context: generic types. Particularly such where at least one type argument remains unassigned. For example:

struct Foo{T}
value::T
end
typeof(Foo) <: UnionAll

But what does this mean? The answer is rather simple: UnionAll represents all specializations of Foo with specified type argument. In a sense, it is a Union with a “placeholder” for the type argument. Hence the…


One of my favorite tools and a double edged blade in the Julia programming language are Meta Types. Loosely related to Metaprogramming, meta types, derived from the Greek word μετα, “transcend” beyond a simple data structure. Rather than simply describe a physical data structure in memory, a meta type includes information on the type itself. Typically, this is may even be all the information the type provides — and the underlying data structure itself is empty. This relates to metaprogramming in that it is a way to manipulate the compiler’s behavior — albeit more indirectly than macros.

Ascension — by Suirebit @ Deviant Art.

The Simplest Meta Type

The simplest form…


This is a particularly niche Julia trick: IOBuffers where data is written to the end and read from the beginning.

Why are Duplex Buffers useful? Duplex Buffers facilitate arbitrary byte-wise communication between two distinct endpoints within your application. They are very akin to Julia’s built-in Channels. In fact, for most applications one will likely prefer the latter for improved semantics and multi-processing capabilities. But sometimes, the application calls for much finer control. …


Decorative image of labels “getters” and “setters” above a code editor.
Decorative image of labels “getters” and “setters” above a code editor.

Julia’s dynamic multiple dispatch is an incredibly powerful language feature. It also powers retrieving fields of objects through getfield, setfield!, hasfield, and various other functions. Some versions ago (somewhere around version 1.1), these methods were complemented with “property” variants— which allow us to implement custom behavior upon accessing (getting) or overriding (setting) the value of a field, or even more interesting: virtual fields which do not physically exist on the object.

An Example

Nothing goes over learning by example. This is how you might implement getters & setters:

abstract type Animal end
abstract type Quadruped <: Animal end
struct Dog <: Quadruped…


Python is an interpreted and dynamically typed language. But that doesn’t mean you should forget entirely about types.

A nifty feature introduced with PEP 484 is called “Type Hints” a.k.a type annotations. Mainly, it simply tells fellow developers, or even just yourself, what type is expected as a function argument or what type is returned. While Python itself does literally nothing with this information (hence “hint”), it is an incredibly invaluable tool for us humans.

The IDE can extract these types and plug them into an IntelliSense system for autocomplete. …


Illustration of a computer network. For decoration.
Illustration of a computer network. For decoration.
Illustration: Computer Network Basics. IP of i-netsolutions.net.

The Scenario

Feel free to skip this section. All I do here is explain why I even worked on this problem.

One of the bigger challenges I have faced while writing Pia.jl is that Julia’s standard library does not provide timeouts for I/O operations whatsoever, particularly including TCP & UDP Sockets. This is likely a direct consequence of the usage of the underlying library: libuv — which in itself does not seem to provide such timeouts. However, it is Julia’s integration which poses a serious problem.

After some experimentation, I discovered that Julia does not immediately read all available data on a…

Kiruse

Freelance Software Engineer | DLT/Blockchain Enthusiast & Future Entrepreneur

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store