summary refs log tree commit diff stats
path: root/lib/pure/md5.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2019-04-11 22:09:11 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-04-11 23:09:11 +0200
commit041d15392aaf732665abab290f0cf5993d909efc (patch)
tree4a4aff6b33707850f7e38e680652bf00e6c5c0df /lib/pure/md5.nim
parentde02fd0b898e41fa91087300d82573d83e357b34 (diff)
downloadNim-041d15392aaf732665abab290f0cf5993d909efc.tar.gz
Compiler plugin for implementing incremental computation in user space (#10819)
This plugin provides essential building block for implementing incremental computations in your programs. The idea behind incremental computations is that if you do the same calculation multiple times but with slightly different inputs you don't have to recompute everything from scratch. Also you don't want to adopt special algorithms either, you would like to write your code in standard from scratch manner and get incrementality for free when it is possible.

The plugin computes the digest of the proc bodies, recursively hashing all called procs as well . Such digest with the digest of the argument values gives a good "name" for the result. Terminology loosely follows paper "Incremental Computation with Names" link below. It works well if you have no side effects in your computations. If you have global state in your computations then you will need problem specific workarounds to represent global state in set of "names" . SideEffect tracking in Nim also useful in this topic.

Classical examples:

Dashboard with ticking data. New data arrives non stop and you would like to update the dashboard recomputing only changed outputs.
Excel spreadsheet where user changes one cell and you would like to recompute all cells that are affected by the change, but do not want to recompute every cell in the spreadsheet.
Diffstat (limited to 'lib/pure/md5.nim')
-rw-r--r--lib/pure/md5.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/md5.nim b/lib/pure/md5.nim
index 794d839f8..ae8e12707 100644
--- a/lib/pure/md5.nim
+++ b/lib/pure/md5.nim
@@ -197,7 +197,9 @@ proc `$`*(d: MD5Digest): string =
     add(result, digits[d[i].int and 0xF])
 
 proc getMD5*(s: string): string =
-  ## Computes an MD5 value of `s` and returns its string representation.
+  ## Computes an MD5 value of `s` and returns its string representation. 
+  ## .. note::
+  ## available at compile time
   ##
   ## See also:
   ## * `toMD5 proc <#toMD5,string>`_ which returns the `MD5Digest` of a string