Posts tagged docs

Resource management

⦿ docs

Exceptions and resource management are important aspects for creating robust systems, because in production unexpected problems can happen and because not immediately released resources can halt a system due to excessive leaking. It is not unusual having a 30% or more of production code devoted to managing these aspects.

Initially I designed exception handling and resource management in the traditional way, with try { .. } catch { .. } finally { .. } code bloks. But then I figured out that resource management is often boiler-plate code, and exception handling code is not very structured because only already open resources can be released, and the repair depends from the point of interruption. So Dok supports resource management (particular in presence of exceptions) favouring metaprogramming compiler rules injecting a default behaviour in code written without explicit resource management.

Exceptions are managed:

  • case A) fixing the problem and re-running the same code, in the Eiffel way
  • case B) signaling the problem to the parent caller, in a traditional way, but inspired also by Erlang approaches

Dok programming language

⦿ docs

This is an initial, incomplete and embarrassing draft of Dok programming language design: /dok-lang/Dok.html.

I have many things to integrate in the language, but the real test-bed will be:

  • the creation of Dok compiler in Dok itself
  • the creation of DokMelody IDE in Dok itself