[Info-vax] Meditech in the news
Arne Vajhøj
arne at vajhoej.dk
Tue Jan 11 19:24:32 EST 2022
On 1/8/2022 2:58 PM, Arne Vajhøj wrote:
> On 1/8/2022 1:40 PM, Scott Dorsey wrote:
>> plugh <jchimene at gmail.com> wrote:
>>> I think one of the aspects of MUmPhs that buggers newbs is that it's
>>> one of=
>>> the few languages implementing content addressable memory, even to
>>> seconda=
>>> ry storage. I've professionally written REXX, which is the only other
>>> such =
>>> language. I'm sure there are others.
>>
>> It's actually become a popular thing recently, with hashes being
>> implemented
>> in perl and python as standard data structures. Not as extensive or
>> transparent as in Mumps, mind you.
>
> In memory hashtables/hashmaps/dictionaries/associative arrays are a
> standard feature in most newer languages.
>
> Index-sequential files/NoSQL Key Value Stores are also common across
> technologies.
>
> The combination is not common. Even though I guess that languages
> that allow overloading of indexing operator could do something
> similar under the hood.
Just for fun here is an example with Kotlin and MapDB.
Plain in memory:
package simple
fun main() {
val m = HashMap<String,Int>()
//
m["A"] = 111
m["B"] = 222
m["C"] = 333
println(m["A"])
println(m["B"])
println(m["C"])
var x = m.getOrDefault("X", 0)
x = x + 1
m["X"] = x
println(m["X"])
//
}
On disk:
package mapdb
import org.mapdb.DBMaker
fun main() {
val db = DBMaker.fileDB("/work/fun.db").make()
@Suppress("UNCHECKED_CAST")
val m = db.hashMap("demo").createOrOpen() as MutableMap<String,Int>
//
m["A"] = 111
m["B"] = 222
m["C"] = 333
println(m["A"])
println(m["B"])
println(m["C"])
var x = m.getOrDefault("X", 0)
x = x + 1
m["X"] = x
println(m["X"])
//
db.close()
}
Arne
More information about the Info-vax
mailing list