Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New Python implementation

132 views
Skip to first unread message

Mr Flibble

unread,
Feb 11, 2021, 7:30:08 AM2/11/21
to

Hi!

I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language. I envision this implementation to be significantly faster than the currently extant Python implementations (which isn't a stretch given how poorly they perform).

Sample neos session (parsing a fibonacci program, neoscript rather than Python in this case):

neos 1.0.0.0 ED-209
] help
h(elp)
s(chema) <path to language schema> Load language schema
l(oad) <path to program> Load program
list List program
c(ompile) Compile program
r(un) Run program
![<expression>] Evaluate expression (enter interactive mode if expression omitted)
:<input> Input (as stdin)
q(uit) Quit neos
lc List loaded concept libraries
t(race) <0|1|2|3|4|5> [<filter>] Compiler trace
m(etrics) Display metrics for running programs
] lc
[neos.core] (file:///D:\code\neos\build\win32\vs2019\x64\Release\core.ncl)
[neos.boolean]
[neos.language]
[neos.logic]
[neos.math]
[neos.module]
[neos.object]
[neos.string]
[neos.math.universal] (file:///D:\code\neos\build\win32\vs2019\x64\Release\core.math.universal.ncl)
] s neoscript
Loading schema 'neoscript'...
Language: Default neoGFX scripting language
Version: 1.0.0
Copyright (C) 2019 Leigh Johnston
neoscript] l examples/neoscript/fibonacci.neo
neoscript] list
File 'examples/neoscript/fibonacci.neo':
-- neoscript example: Fibonacci

using neos.string;
using neos.stream;

import fn to_string(x : i32) -> string;
import fn to_integer(s : string) -> i32;
import proc input(s : out string);
import proc print(s : in string);

-- functions are pure
def fn add(x, y : i32) -> i32
{
return x + y;
}
def fn fib(x : i32) -> i32
{
if (x < 2)
return 1;
else
return add(fib(x-1), fib(x-2));
}

-- procedures are impure
def proc main()
s : string;
{
print("Enter a positive "
"integer: ");
input(s);
print("Fibonacci(" + s + ") = " + to_string(fib(to_integer(s))) + "\n");
}
neoscript] t 1
neoscript] c
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g)
folding: string.utf8(g) <- string.utf8.character.alpha()
folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn)
folding: string.utf8(gn) <- string.utf8.character.alpha()
folded: string.utf8(gn) <- string.utf8.character.alpha() = string.utf8(gni)
folding: string.utf8(gni) <- string.utf8.character.alpha()
folded: string.utf8(gni) <- string.utf8.character.alpha() = string.utf8(gnir)
folding: string.utf8(gnir) <- string.utf8.character.alpha()
folded: string.utf8(gnir) <- string.utf8.character.alpha() = string.utf8(gnirt)
folding: string.utf8(gnirt) <- string.utf8.character.alpha()
folded: string.utf8(gnirt) <- string.utf8.character.alpha() = string.utf8(gnirts)
folding: string.utf8(gnirts) <- string.utf8.character.period()
folded: string.utf8(gnirts) <- string.utf8.character.period() = string.utf8(gnirts.)
folding: string.utf8(gnirts.) <- string.utf8.character.alpha()
folded: string.utf8(gnirts.) <- string.utf8.character.alpha() = string.utf8(gnirts.s)
folding: string.utf8(gnirts.s) <- string.utf8.character.alpha()
folded: string.utf8(gnirts.s) <- string.utf8.character.alpha() = string.utf8(gnirts.so)
folding: string.utf8(gnirts.so) <- string.utf8.character.alpha()
folded: string.utf8(gnirts.so) <- string.utf8.character.alpha() = string.utf8(gnirts.soe)
folding: string.utf8(gnirts.soe) <- string.utf8.character.alpha()
folded: string.utf8(gnirts.soe) <- string.utf8.character.alpha() = string.utf8(gnirts.soen)
folding: source.package.name() <- string.utf8(gnirts.soen)
folded: source.package.name() <- string.utf8(gnirts.soen) = source.package.name(neos.string)
folding: source.package.import() <- source.package.name(neos.string)
folded: source.package.import() <- source.package.name(neos.string) = source.package.import(neos.string)
folding: source.package.import(neos.string) <- source.package.import(neos.string)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g)
folding: string.utf8(g) <- string.utf8.character.alpha()
folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn)
folding: string.utf8(gn) <- string.utf8.character.alpha()
folded: string.utf8(gn) <- string.utf8.character.alpha() = string.utf8(gni)
folding: string.utf8(gni) <- string.utf8.character.alpha()
folded: string.utf8(gni) <- string.utf8.character.alpha() = string.utf8(gnir)
folding: string.utf8(gnir) <- string.utf8.character.alpha()
folded: string.utf8(gnir) <- string.utf8.character.alpha() = string.utf8(gnirt)
folding: string.utf8(gnirt) <- string.utf8.character.alpha()
folded: string.utf8(gnirt) <- string.utf8.character.alpha() = string.utf8(gnirts)
folding: string.utf8(gnirts) <- string.utf8.character.underscore()
folded: string.utf8(gnirts) <- string.utf8.character.underscore() = string.utf8(gnirts_)
folding: string.utf8(gnirts_) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_) <- string.utf8.character.alpha() = string.utf8(gnirts_o)
folding: string.utf8(gnirts_o) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_o) <- string.utf8.character.alpha() = string.utf8(gnirts_ot)
folding: language.identifier() <- string.utf8(gnirts_ot)
folded: language.identifier() <- string.utf8(gnirts_ot) = language.identifier(to_string)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(r)
folding: string.utf8(r) <- string.utf8.character.alpha()
folded: string.utf8(r) <- string.utf8.character.alpha() = string.utf8(re)
folding: string.utf8(re) <- string.utf8.character.alpha()
folded: string.utf8(re) <- string.utf8.character.alpha() = string.utf8(reg)
folding: string.utf8(reg) <- string.utf8.character.alpha()
folded: string.utf8(reg) <- string.utf8.character.alpha() = string.utf8(rege)
folding: string.utf8(rege) <- string.utf8.character.alpha()
folded: string.utf8(rege) <- string.utf8.character.alpha() = string.utf8(reget)
folding: string.utf8(reget) <- string.utf8.character.alpha()
folded: string.utf8(reget) <- string.utf8.character.alpha() = string.utf8(regetn)
folding: string.utf8(regetn) <- string.utf8.character.alpha()
folded: string.utf8(regetn) <- string.utf8.character.alpha() = string.utf8(regetni)
folding: string.utf8(regetni) <- string.utf8.character.underscore()
folded: string.utf8(regetni) <- string.utf8.character.underscore() = string.utf8(regetni_)
folding: string.utf8(regetni_) <- string.utf8.character.alpha()
folded: string.utf8(regetni_) <- string.utf8.character.alpha() = string.utf8(regetni_o)
folding: string.utf8(regetni_o) <- string.utf8.character.alpha()
folded: string.utf8(regetni_o) <- string.utf8.character.alpha() = string.utf8(regetni_ot)
folding: language.identifier() <- string.utf8(regetni_ot)
folded: language.identifier() <- string.utf8(regetni_ot) = language.identifier(to_integer)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folded: source.package.import(neos.string) <- source.package.import(neos.string) = ()
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(m)
folding: string.utf8(m) <- string.utf8.character.alpha()
folded: string.utf8(m) <- string.utf8.character.alpha() = string.utf8(ma)
folding: string.utf8(ma) <- string.utf8.character.alpha()
folded: string.utf8(ma) <- string.utf8.character.alpha() = string.utf8(mae)
folding: string.utf8(mae) <- string.utf8.character.alpha()
folded: string.utf8(mae) <- string.utf8.character.alpha() = string.utf8(maer)
folding: string.utf8(maer) <- string.utf8.character.alpha()
folded: string.utf8(maer) <- string.utf8.character.alpha() = string.utf8(maert)
folding: string.utf8(maert) <- string.utf8.character.alpha()
folded: string.utf8(maert) <- string.utf8.character.alpha() = string.utf8(maerts)
folding: string.utf8(maerts) <- string.utf8.character.period()
folded: string.utf8(maerts) <- string.utf8.character.period() = string.utf8(maerts.)
folding: string.utf8(maerts.) <- string.utf8.character.alpha()
folded: string.utf8(maerts.) <- string.utf8.character.alpha() = string.utf8(maerts.s)
folding: string.utf8(maerts.s) <- string.utf8.character.alpha()
folded: string.utf8(maerts.s) <- string.utf8.character.alpha() = string.utf8(maerts.so)
folding: string.utf8(maerts.so) <- string.utf8.character.alpha()
folded: string.utf8(maerts.so) <- string.utf8.character.alpha() = string.utf8(maerts.soe)
folding: string.utf8(maerts.soe) <- string.utf8.character.alpha()
folded: string.utf8(maerts.soe) <- string.utf8.character.alpha() = string.utf8(maerts.soen)
folding: source.package.name() <- string.utf8(maerts.soen)
folded: source.package.name() <- string.utf8(maerts.soen) = source.package.name(neos.stream)
folding: source.package.import() <- source.package.name(neos.stream)
folded: source.package.import() <- source.package.name(neos.stream) = source.package.import(neos.stream)
folding: source.package.import(neos.stream) <- source.package.import(neos.stream)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tu)
folding: string.utf8(tu) <- string.utf8.character.alpha()
folded: string.utf8(tu) <- string.utf8.character.alpha() = string.utf8(tup)
folding: string.utf8(tup) <- string.utf8.character.alpha()
folded: string.utf8(tup) <- string.utf8.character.alpha() = string.utf8(tupn)
folding: string.utf8(tupn) <- string.utf8.character.alpha()
folded: string.utf8(tupn) <- string.utf8.character.alpha() = string.utf8(tupni)
folding: language.identifier() <- string.utf8(tupni)
folded: language.identifier() <- string.utf8(tupni) = language.identifier(input)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tn)
folding: string.utf8(tn) <- string.utf8.character.alpha()
folded: string.utf8(tn) <- string.utf8.character.alpha() = string.utf8(tni)
folding: string.utf8(tni) <- string.utf8.character.alpha()
folded: string.utf8(tni) <- string.utf8.character.alpha() = string.utf8(tnir)
folding: string.utf8(tnir) <- string.utf8.character.alpha()
folded: string.utf8(tnir) <- string.utf8.character.alpha() = string.utf8(tnirp)
folding: language.identifier() <- string.utf8(tnirp)
folded: language.identifier() <- string.utf8(tnirp) = language.identifier(print)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folded: source.package.import(neos.stream) <- source.package.import(neos.stream) = ()
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g)
folding: string.utf8(g) <- string.utf8.character.alpha()
folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn)
folding: string.utf8(gn) <- string.utf8.character.alpha()
folded: string.utf8(gn) <- string.utf8.character.alpha() = string.utf8(gni)
folding: string.utf8(gni) <- string.utf8.character.alpha()
folded: string.utf8(gni) <- string.utf8.character.alpha() = string.utf8(gnir)
folding: string.utf8(gnir) <- string.utf8.character.alpha()
folded: string.utf8(gnir) <- string.utf8.character.alpha() = string.utf8(gnirt)
folding: string.utf8(gnirt) <- string.utf8.character.alpha()
folded: string.utf8(gnirt) <- string.utf8.character.alpha() = string.utf8(gnirts)
folding: string.utf8(gnirts) <- string.utf8.character.underscore()
folded: string.utf8(gnirts) <- string.utf8.character.underscore() = string.utf8(gnirts_)
folding: string.utf8(gnirts_) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_) <- string.utf8.character.alpha() = string.utf8(gnirts_o)
folding: string.utf8(gnirts_o) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_o) <- string.utf8.character.alpha() = string.utf8(gnirts_ot)
folding: language.identifier() <- string.utf8(gnirts_ot)
folded: language.identifier() <- string.utf8(gnirts_ot) = language.identifier(to_string)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(r)
folding: string.utf8(r) <- string.utf8.character.alpha()
folded: string.utf8(r) <- string.utf8.character.alpha() = string.utf8(re)
folding: string.utf8(re) <- string.utf8.character.alpha()
folded: string.utf8(re) <- string.utf8.character.alpha() = string.utf8(reg)
folding: string.utf8(reg) <- string.utf8.character.alpha()
folded: string.utf8(reg) <- string.utf8.character.alpha() = string.utf8(rege)
folding: string.utf8(rege) <- string.utf8.character.alpha()
folded: string.utf8(rege) <- string.utf8.character.alpha() = string.utf8(reget)
folding: string.utf8(reget) <- string.utf8.character.alpha()
folded: string.utf8(reget) <- string.utf8.character.alpha() = string.utf8(regetn)
folding: string.utf8(regetn) <- string.utf8.character.alpha()
folded: string.utf8(regetn) <- string.utf8.character.alpha() = string.utf8(regetni)
folding: string.utf8(regetni) <- string.utf8.character.underscore()
folded: string.utf8(regetni) <- string.utf8.character.underscore() = string.utf8(regetni_)
folding: string.utf8(regetni_) <- string.utf8.character.alpha()
folded: string.utf8(regetni_) <- string.utf8.character.alpha() = string.utf8(regetni_o)
folding: string.utf8(regetni_o) <- string.utf8.character.alpha()
folded: string.utf8(regetni_o) <- string.utf8.character.alpha() = string.utf8(regetni_ot)
folding: language.identifier() <- string.utf8(regetni_ot)
folded: language.identifier() <- string.utf8(regetni_ot) = language.identifier(to_integer)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tu)
folding: string.utf8(tu) <- string.utf8.character.alpha()
folded: string.utf8(tu) <- string.utf8.character.alpha() = string.utf8(tup)
folding: string.utf8(tup) <- string.utf8.character.alpha()
folded: string.utf8(tup) <- string.utf8.character.alpha() = string.utf8(tupn)
folding: string.utf8(tupn) <- string.utf8.character.alpha()
folded: string.utf8(tupn) <- string.utf8.character.alpha() = string.utf8(tupni)
folding: language.identifier() <- string.utf8(tupni)
folded: language.identifier() <- string.utf8(tupni) = language.identifier(input)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tn)
folding: string.utf8(tn) <- string.utf8.character.alpha()
folded: string.utf8(tn) <- string.utf8.character.alpha() = string.utf8(tni)
folding: string.utf8(tni) <- string.utf8.character.alpha()
folded: string.utf8(tni) <- string.utf8.character.alpha() = string.utf8(tnir)
folding: string.utf8(tnir) <- string.utf8.character.alpha()
folded: string.utf8(tnir) <- string.utf8.character.alpha() = string.utf8(tnirp)
folding: language.identifier() <- string.utf8(tnirp)
folded: language.identifier() <- string.utf8(tnirp) = language.identifier(print)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(d)
folding: string.utf8(d) <- string.utf8.character.alpha()
folded: string.utf8(d) <- string.utf8.character.alpha() = string.utf8(dd)
folding: string.utf8(dd) <- string.utf8.character.alpha()
folded: string.utf8(dd) <- string.utf8.character.alpha() = string.utf8(dda)
folding: language.identifier() <- string.utf8(dda)
folded: language.identifier() <- string.utf8(dda) = language.identifier(add)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(y)
folding: language.identifier() <- string.utf8(y)
folded: language.identifier() <- string.utf8(y) = language.identifier(y)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(y)
folding: language.identifier() <- string.utf8(y)
folded: language.identifier() <- string.utf8(y) = language.identifier(y)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(b)
folding: string.utf8(b) <- string.utf8.character.alpha()
folded: string.utf8(b) <- string.utf8.character.alpha() = string.utf8(bi)
folding: string.utf8(bi) <- string.utf8.character.alpha()
folded: string.utf8(bi) <- string.utf8.character.alpha() = string.utf8(bif)
folding: language.identifier() <- string.utf8(bif)
folded: language.identifier() <- string.utf8(bif) = language.identifier(fib)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(d)
folding: string.utf8(d) <- string.utf8.character.alpha()
folded: string.utf8(d) <- string.utf8.character.alpha() = string.utf8(dd)
folding: string.utf8(dd) <- string.utf8.character.alpha()
folded: string.utf8(dd) <- string.utf8.character.alpha() = string.utf8(dda)
folding: language.identifier() <- string.utf8(dda)
folded: language.identifier() <- string.utf8(dda) = language.identifier(add)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(b)
folding: string.utf8(b) <- string.utf8.character.alpha()
folded: string.utf8(b) <- string.utf8.character.alpha() = string.utf8(bi)
folding: string.utf8(bi) <- string.utf8.character.alpha()
folded: string.utf8(bi) <- string.utf8.character.alpha() = string.utf8(bif)
folding: language.identifier() <- string.utf8(bif)
folded: language.identifier() <- string.utf8(bif) = language.identifier(fib)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(b)
folding: string.utf8(b) <- string.utf8.character.alpha()
folded: string.utf8(b) <- string.utf8.character.alpha() = string.utf8(bi)
folding: string.utf8(bi) <- string.utf8.character.alpha()
folded: string.utf8(bi) <- string.utf8.character.alpha() = string.utf8(bif)
folding: language.identifier() <- string.utf8(bif)
folded: language.identifier() <- string.utf8(bif) = language.identifier(fib)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(x)
folding: language.identifier() <- string.utf8(x)
folded: language.identifier() <- string.utf8(x) = language.identifier(x)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(n)
folding: string.utf8(n) <- string.utf8.character.alpha()
folded: string.utf8(n) <- string.utf8.character.alpha() = string.utf8(ni)
folding: string.utf8(ni) <- string.utf8.character.alpha()
folded: string.utf8(ni) <- string.utf8.character.alpha() = string.utf8(nia)
folding: string.utf8(nia) <- string.utf8.character.alpha()
folded: string.utf8(nia) <- string.utf8.character.alpha() = string.utf8(niam)
folding: language.identifier() <- string.utf8(niam)
folded: language.identifier() <- string.utf8(niam) = language.identifier(main)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tn)
folding: string.utf8(tn) <- string.utf8.character.alpha()
folded: string.utf8(tn) <- string.utf8.character.alpha() = string.utf8(tni)
folding: string.utf8(tni) <- string.utf8.character.alpha()
folded: string.utf8(tni) <- string.utf8.character.alpha() = string.utf8(tnir)
folding: string.utf8(tnir) <- string.utf8.character.alpha()
folded: string.utf8(tnir) <- string.utf8.character.alpha() = string.utf8(tnirp)
folding: language.identifier() <- string.utf8(tnirp)
folded: language.identifier() <- string.utf8(tnirp) = language.identifier(print)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8( )
folding: string.utf8( ) <- string.utf8.character.alpha()
folded: string.utf8( ) <- string.utf8.character.alpha() = string.utf8(
folding: string.utf8( <- string.utf8.character.alpha()
folded: string.utf8( <- string.utf8.character.alpha() = string.utf8( :r)
folding: string.utf8( :r) <- string.utf8.character.alpha()
folded: string.utf8( :r) <- string.utf8.character.alpha() = string.utf8( :re)
folding: string.utf8( :re) <- string.utf8.character.alpha()
folded: string.utf8( :re) <- string.utf8.character.alpha() = string.utf8( :reg)
folding: string.utf8( :reg) <- string.utf8.character.alpha()
folded: string.utf8( :reg) <- string.utf8.character.alpha() = string.utf8( :rege)
folding: string.utf8( :rege) <- string.utf8.character.alpha()
folded: string.utf8( :rege) <- string.utf8.character.alpha() = string.utf8( :reget)
folding: string.utf8( :reget) <- string.utf8.character.alpha()
folded: string.utf8( :reget) <- string.utf8.character.alpha() = string.utf8( :regetn)
folding: string.utf8( :regetn) <- string.utf8.character.alpha()
folded: string.utf8( :regetn) <- string.utf8.character.alpha() = string.utf8( :regetni)
folding: string.utf8( :regetni) <- string.utf8.character.alpha()
folded: string.utf8( :regetni) <- string.utf8.character.alpha() = string.utf8( :regetni )
folding: string.utf8( :regetni ) <- string.utf8.character.alpha()
folded: string.utf8( :regetni ) <- string.utf8.character.alpha() = string.utf8( :regetni e)
folding: string.utf8( :regetni e) <- string.utf8.character.alpha()
folded: string.utf8( :regetni e) <- string.utf8.character.alpha() = string.utf8( :regetni ev)
folding: string.utf8( :regetni ev) <- string.utf8.character.alpha()
folded: string.utf8( :regetni ev) <- string.utf8.character.alpha() = string.utf8( :regetni evi)
folding: string.utf8( :regetni evi) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evi) <- string.utf8.character.alpha() = string.utf8( :regetni evit)
folding: string.utf8( :regetni evit) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evit) <- string.utf8.character.alpha() = string.utf8( :regetni eviti)
folding: string.utf8( :regetni eviti) <- string.utf8.character.alpha()
folded: string.utf8( :regetni eviti) <- string.utf8.character.alpha() = string.utf8( :regetni evitis)
folding: string.utf8( :regetni evitis) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitis) <- string.utf8.character.alpha() = string.utf8( :regetni evitiso)
folding: string.utf8( :regetni evitiso) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitiso) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop)
folding: string.utf8( :regetni evitisop) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop )
folding: string.utf8( :regetni evitisop ) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop ) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a)
folding: string.utf8( :regetni evitisop a) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a )
folding: string.utf8( :regetni evitisop a ) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a ) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a r)
folding: string.utf8( :regetni evitisop a r) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a r) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a re)
folding: string.utf8( :regetni evitisop a re) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a re) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a ret)
folding: string.utf8( :regetni evitisop a ret) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a ret) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a retn)
folding: string.utf8( :regetni evitisop a retn) <- string.utf8.character.alpha()
folded: string.utf8( :regetni evitisop a retn) <- string.utf8.character.alpha() = string.utf8( :regetni evitisop a retnE)
folding: string.utf8( :regetni evitisop a retnE) <- string.utf8( :regetni evitisop a retnE)
folded: string.utf8( :regetni evitisop a retnE) <- string.utf8( :regetni evitisop a retnE) = string.utf8(Enter a positive integer: )
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tu)
folding: string.utf8(tu) <- string.utf8.character.alpha()
folded: string.utf8(tu) <- string.utf8.character.alpha() = string.utf8(tup)
folding: string.utf8(tup) <- string.utf8.character.alpha()
folded: string.utf8(tup) <- string.utf8.character.alpha() = string.utf8(tupn)
folding: string.utf8(tupn) <- string.utf8.character.alpha()
folded: string.utf8(tupn) <- string.utf8.character.alpha() = string.utf8(tupni)
folding: language.identifier() <- string.utf8(tupni)
folded: language.identifier() <- string.utf8(tupni) = language.identifier(input)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(t)
folding: string.utf8(t) <- string.utf8.character.alpha()
folded: string.utf8(t) <- string.utf8.character.alpha() = string.utf8(tn)
folding: string.utf8(tn) <- string.utf8.character.alpha()
folded: string.utf8(tn) <- string.utf8.character.alpha() = string.utf8(tni)
folding: string.utf8(tni) <- string.utf8.character.alpha()
folded: string.utf8(tni) <- string.utf8.character.alpha() = string.utf8(tnir)
folding: string.utf8(tnir) <- string.utf8.character.alpha()
folded: string.utf8(tnir) <- string.utf8.character.alpha() = string.utf8(tnirp)
folding: language.identifier() <- string.utf8(tnirp)
folded: language.identifier() <- string.utf8(tnirp) = language.identifier(print)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(()
folding: string.utf8(() <- string.utf8.character.alpha()
folded: string.utf8(() <- string.utf8.character.alpha() = string.utf8((i)
folding: string.utf8((i) <- string.utf8.character.alpha()
folded: string.utf8((i) <- string.utf8.character.alpha() = string.utf8((ic)
folding: string.utf8((ic) <- string.utf8.character.alpha()
folded: string.utf8((ic) <- string.utf8.character.alpha() = string.utf8((icc)
folding: string.utf8((icc) <- string.utf8.character.alpha()
folded: string.utf8((icc) <- string.utf8.character.alpha() = string.utf8((icca)
folding: string.utf8((icca) <- string.utf8.character.alpha()
folded: string.utf8((icca) <- string.utf8.character.alpha() = string.utf8((iccan)
folding: string.utf8((iccan) <- string.utf8.character.alpha()
folded: string.utf8((iccan) <- string.utf8.character.alpha() = string.utf8((iccano)
folding: string.utf8((iccano) <- string.utf8.character.alpha()
folded: string.utf8((iccano) <- string.utf8.character.alpha() = string.utf8((iccanob)
folding: string.utf8((iccanob) <- string.utf8.character.alpha()
folded: string.utf8((iccanob) <- string.utf8.character.alpha() = string.utf8((iccanobi)
folding: string.utf8((iccanobi) <- string.utf8.character.alpha()
folded: string.utf8((iccanobi) <- string.utf8.character.alpha() = string.utf8((iccanobiF)
folding: string.utf8((iccanobiF) <- string.utf8((iccanobiF)
folded: string.utf8((iccanobiF) <- string.utf8((iccanobiF) = string.utf8(Fibonacci()
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8( )
folding: string.utf8( ) <- string.utf8.character.alpha()
folded: string.utf8( ) <- string.utf8.character.alpha() = string.utf8( =)
folding: string.utf8( =) <- string.utf8.character.alpha()
folded: string.utf8( =) <- string.utf8.character.alpha() = string.utf8( = )
folding: string.utf8( = ) <- string.utf8.character.alpha()
folded: string.utf8( = ) <- string.utf8.character.alpha() = string.utf8( = ))
folding: string.utf8( = )) <- string.utf8( = ))
folded: string.utf8( = )) <- string.utf8( = )) = string.utf8() = )
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(g)
folding: string.utf8(g) <- string.utf8.character.alpha()
folded: string.utf8(g) <- string.utf8.character.alpha() = string.utf8(gn)
folding: string.utf8(gn) <- string.utf8.character.alpha()
folded: string.utf8(gn) <- string.utf8.character.alpha() = string.utf8(gni)
folding: string.utf8(gni) <- string.utf8.character.alpha()
folded: string.utf8(gni) <- string.utf8.character.alpha() = string.utf8(gnir)
folding: string.utf8(gnir) <- string.utf8.character.alpha()
folded: string.utf8(gnir) <- string.utf8.character.alpha() = string.utf8(gnirt)
folding: string.utf8(gnirt) <- string.utf8.character.alpha()
folded: string.utf8(gnirt) <- string.utf8.character.alpha() = string.utf8(gnirts)
folding: string.utf8(gnirts) <- string.utf8.character.underscore()
folded: string.utf8(gnirts) <- string.utf8.character.underscore() = string.utf8(gnirts_)
folding: string.utf8(gnirts_) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_) <- string.utf8.character.alpha() = string.utf8(gnirts_o)
folding: string.utf8(gnirts_o) <- string.utf8.character.alpha()
folded: string.utf8(gnirts_o) <- string.utf8.character.alpha() = string.utf8(gnirts_ot)
folding: language.identifier() <- string.utf8(gnirts_ot)
folded: language.identifier() <- string.utf8(gnirts_ot) = language.identifier(to_string)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(b)
folding: string.utf8(b) <- string.utf8.character.alpha()
folded: string.utf8(b) <- string.utf8.character.alpha() = string.utf8(bi)
folding: string.utf8(bi) <- string.utf8.character.alpha()
folded: string.utf8(bi) <- string.utf8.character.alpha() = string.utf8(bif)
folding: language.identifier() <- string.utf8(bif)
folded: language.identifier() <- string.utf8(bif) = language.identifier(fib)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(r)
folding: string.utf8(r) <- string.utf8.character.alpha()
folded: string.utf8(r) <- string.utf8.character.alpha() = string.utf8(re)
folding: string.utf8(re) <- string.utf8.character.alpha()
folded: string.utf8(re) <- string.utf8.character.alpha() = string.utf8(reg)
folding: string.utf8(reg) <- string.utf8.character.alpha()
folded: string.utf8(reg) <- string.utf8.character.alpha() = string.utf8(rege)
folding: string.utf8(rege) <- string.utf8.character.alpha()
folded: string.utf8(rege) <- string.utf8.character.alpha() = string.utf8(reget)
folding: string.utf8(reget) <- string.utf8.character.alpha()
folded: string.utf8(reget) <- string.utf8.character.alpha() = string.utf8(regetn)
folding: string.utf8(regetn) <- string.utf8.character.alpha()
folded: string.utf8(regetn) <- string.utf8.character.alpha() = string.utf8(regetni)
folding: string.utf8(regetni) <- string.utf8.character.underscore()
folded: string.utf8(regetni) <- string.utf8.character.underscore() = string.utf8(regetni_)
folding: string.utf8(regetni_) <- string.utf8.character.alpha()
folded: string.utf8(regetni_) <- string.utf8.character.alpha() = string.utf8(regetni_o)
folding: string.utf8(regetni_o) <- string.utf8.character.alpha()
folded: string.utf8(regetni_o) <- string.utf8.character.alpha() = string.utf8(regetni_ot)
folding: language.identifier() <- string.utf8(regetni_ot)
folded: language.identifier() <- string.utf8(regetni_ot) = language.identifier(to_integer)
folding: string.utf8() <- string.utf8.character.alpha()
folded: string.utf8() <- string.utf8.character.alpha() = string.utf8(s)
folding: language.identifier() <- string.utf8(s)
folded: language.identifier() <- string.utf8(s) = language.identifier(s)
folding: string.utf8() <- string.utf8.character.LF()
folded: string.utf8() <- string.utf8.character.LF() = string.utf8( )
folding: string.utf8( ) <- string.utf8( )
folded: string.utf8( ) <- string.utf8( ) = string.utf8( )
Compilation time: 336.892ms
neoscript]

Message ends.

/Flibble

--
😎

Paavo Helde

unread,
Feb 11, 2021, 9:51:52 AM2/11/21
to
11.02.2021 14:29 Mr Flibble kirjutas:
>
> Hi!
>
> I am starting work on creating a new Python implementation from scratch
> using "neos" my universal compiler that can compile any programming
> language.  I envision this implementation to be significantly faster
> than the currently extant Python implementations (which isn't a stretch
> given how poorly they perform).

Could you please take care to have it properly multithreadable? A GIL
lock is not something worth to replicate. A good principle would be to
have no global static state at all.

mick...@potatofield.co.uk

unread,
Feb 11, 2021, 10:46:24 AM2/11/21
to
On Thu, 11 Feb 2021 16:51:34 +0200
Paavo Helde <myfir...@osa.pri.ee> wrote:
>11.02.2021 14:29 Mr Flibble kirjutas:
>>
>> Hi!
>>
>> I am starting work on creating a new Python implementation from scratch
>> using "neos" my universal compiler that can compile any programming
>> language.  I envision this implementation to be significantly faster

Any? Hows it going with declarative languages such as SQL or Prolog then?

>> than the currently extant Python implementations (which isn't a stretch
>> given how poorly they perform).
>
>Could you please take care to have it properly multithreadable? A GIL
>lock is not something worth to replicate. A good principle would be to
>have no global static state at all.

Or better yet forget threads and go multiprocess. If you're developing
on a proper OS anyway, on Windows the pain isn't worth it I imagine.

David Brown

unread,
Feb 11, 2021, 12:13:49 PM2/11/21
to
Removing the GIL always sounds like a great idea, but remember it would
make a lot of Python code incompatible. Some people writing Python code
will assume that certain operations - assignment being a key example -
are atomic and safe to do in threaded code. The GIL can therefore make
it easier to write thread-safe code in Python, because you don't need
explicit locks for many uses of shared state.

You can certainly argue that the GIL was an unfortunate implementation
choice when Python was first created, and you can certainly argue that
relying on it in this way is questionable practice. But there is plenty
of Python code that /does/ rely on it that way.

Standard practice for efficient Python coding is to avoid doing too much
hard work in pure Python. Anything really time-consuming should be done
externally - such as OS calls, extension libraries for image processing,
databases, numpty, etc. These all release the GIL before doing their
work, thus giving you good multi-threading performance. It's only if
you are trying to do a lot of calculations or time-consuming work in
pure Python in multiple threads that the GIL is a problem. And if
that's the case, you can usually use the "processing" library instead of
the "threading" library and get your multi-processing that way.

Mr Flibble

unread,
Feb 11, 2021, 12:37:51 PM2/11/21
to
On 11/02/2021 15:46, mick...@potatofield.co.uk wrote:
> On Thu, 11 Feb 2021 16:51:34 +0200
> Paavo Helde <myfir...@osa.pri.ee> wrote:
>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>
>>> Hi!
>>>
>>> I am starting work on creating a new Python implementation from scratch
>>> using "neos" my universal compiler that can compile any programming
>>> language.  I envision this implementation to be significantly faster
>
> Any? Hows it going with declarative languages such as SQL or Prolog then?

Yes, any. Why do you feel the need to ask about declarative languages specifically?

>
>>> than the currently extant Python implementations (which isn't a stretch
>>> given how poorly they perform).
>>
>> Could you please take care to have it properly multithreadable? A GIL
>> lock is not something worth to replicate. A good principle would be to
>> have no global static state at all.
>
> Or better yet forget threads and go multiprocess. If you're developing
> on a proper OS anyway, on Windows the pain isn't worth it I imagine.

You serious, bruv? Threads are essential.

/Flibble

--
😎

Paavo Helde

unread,
Feb 11, 2021, 1:13:50 PM2/11/21
to
11.02.2021 19:13 David Brown kirjutas:
> On 11/02/2021 15:51, Paavo Helde wrote:
>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>
>>> Hi!
>>>
>>> I am starting work on creating a new Python implementation from
>>> scratch using "neos" my universal compiler that can compile any
>>> programming language.  I envision this implementation to be
>>> significantly faster than the currently extant Python implementations
>>> (which isn't a stretch given how poorly they perform).
>>
>> Could you please take care to have it properly multithreadable? A GIL
>> lock is not something worth to replicate. A good principle would be to
>> have no global static state at all.
>
> Removing the GIL always sounds like a great idea, but remember it would
> make a lot of Python code incompatible.

I'm sure Mr Flibble does not care about such things very much ;-)

> Some people writing Python code
> will assume that certain operations - assignment being a key example -
> are atomic and safe to do in threaded code.

There is zero need that a scripting language sees the same data state in
all threads. Actually it's the opposite, because any kind of shared
state needs synhronization and should be avoided as much as possible.

> The GIL can therefore make
> it easier to write thread-safe code in Python, because you don't need
> explicit locks for many uses of shared state.

Locking a data state at script level does not scale anyway. A much
better approach is to use message queues for communicating between threads.

> You can certainly argue that the GIL was an unfortunate implementation
> choice when Python was first created, and you can certainly argue that
> relying on it in this way is questionable practice. But there is plenty
> of Python code that /does/ rely on it that way.

This does not make this code right.

>
> Standard practice for efficient Python coding is to avoid doing too much
> hard work in pure Python. Anything really time-consuming should be done
> externally - such as OS calls, extension libraries for image processing,
> databases, numpty, etc. These all release the GIL before doing their
> work, thus giving you good multi-threading performance. It's only if
> you are trying to do a lot of calculations or time-consuming work in
> pure Python in multiple threads that the GIL is a problem. And if
> that's the case, you can usually use the "processing" library instead of
> the "threading" library and get your multi-processing that way.

All this "standard practice" is the consequence of the fact that Python
does not support multithreading properly.



Bonita Montero

unread,
Feb 11, 2021, 1:58:29 PM2/11/21
to
Python isn't used for Performance-critical code at all when it
comes to the speed of the interpretation of the language itself.
So your work would be worthless in this sense. But sometimes
people use native libraries with Python which result in perfor-
mant solution. But in this case your solution would be worthless
either.

Mr Flibble

unread,
Feb 11, 2021, 2:01:28 PM2/11/21
to
You think my solution is worthless because you have no clue whatsoever about what problem it is solving, dear.

/Flibble

--
😎

Bonita Montero

unread,
Feb 11, 2021, 2:16:02 PM2/11/21
to
> You think my solution is worthless because you have no clue whatsoever
> about what problem it is solving, dear.

Then tell me what are the typical performance-sensitive applications
written in Python and depending on the speed of the langugage itself
and not the libraries are.
I think you're an dreaming idiot which isn't capable to master such
a huge project.

Mr Flibble

unread,
Feb 11, 2021, 2:37:53 PM2/11/21
to
Obviously as you have not learnt anything new since your last reply you simply repeat yourself as you still have no clue.

/Flibble

--
😎

Bonita Montero

unread,
Feb 11, 2021, 2:47:57 PM2/11/21
to
>> Then tell me what are the typical performance-sensitive applications
>> written in Python and depending on the speed of the langugage itself
>> and not the libraries are.
>> I think you're an dreaming idiot which isn't capable to master such
>> a huge project.

> Obviously as you have not learnt anything new since your last reply
> you simply repeat yourself as you still have no clue.

You have nothing to argue to what I've said.

Mr Flibble

unread,
Feb 11, 2021, 2:50:42 PM2/11/21
to
What you said is not even wrong so there is no suitable response other than simple dismissal. You have no clue about what I am doing or why.

/Flibble

--
😎

Bonita Montero

unread,
Feb 11, 2021, 2:54:09 PM2/11/21
to
> You have no clue about what I am doing or why.

You're simply not capable to write a Python-implementation.

Ben Bacarisse

unread,
Feb 11, 2021, 4:14:40 PM2/11/21
to
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> writes:

> I am starting work on creating a new Python implementation from
> scratch using "neos" my universal compiler that can compile any
> programming language.

Is there a published paper describing this work? I thought the idea of
a universal compiler had bitten the dust, so I'm curious so see what
your approach is.

--
Ben.

David Brown

unread,
Feb 11, 2021, 4:18:42 PM2/11/21
to
On 11/02/2021 19:13, Paavo Helde wrote:
> 11.02.2021 19:13 David Brown kirjutas:
>> On 11/02/2021 15:51, Paavo Helde wrote:
>>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>>
>>>> Hi!
>>>>
>>>> I am starting work on creating a new Python implementation from
>>>> scratch using "neos" my universal compiler that can compile any
>>>> programming language.  I envision this implementation to be
>>>> significantly faster than the currently extant Python implementations
>>>> (which isn't a stretch given how poorly they perform).
>>>
>>> Could you please take care to have it properly multithreadable? A GIL
>>> lock is not something worth to replicate. A good principle would be to
>>> have no global static state at all.
>>
>> Removing the GIL always sounds like a great idea, but remember it would
>> make a lot of Python code incompatible. 
>
> I'm sure Mr Flibble does not care about such things very much ;-)

Well, it's entirely up to him how he handles this. I can merely make
some comments that he can take into consideration. I don't know Mr.
Flibble's priorities here - perhaps existing Python code is irrelevant
for his uses.

>
>> Some people writing Python code
>> will assume that certain operations - assignment being a key example -
>> are atomic and safe to do in threaded code.
>
> There is zero need that a scripting language sees the same data state in
> all threads. Actually it's the opposite, because any kind of shared
> state needs synhronization and should be avoided as much as possible.
>

Python is not a scripting language. It is a general purpose language
that works well for short scripts, amongst other things - it is used for
a /huge/ range of program types.

My point is that because of the GIL, a lot of shared state in Python
does not need any kind of synchronisation effort - the GIL gives you
that naturally.

There are, of course, good reasons for minimising shared state, and I
agree that message queues (which are easy in Python, and work almost
identically between threads or processes if you really need active
multitasking in plain Python) are an excellent way to handle information
sharing between threads and processes.

But I am not arguing about what is the "best" way to structure code in
Python or any other language. I am pointing out how some code /is/
written in Python. And relying on the GIL in this way is not entirely
unreasonable for code, because you know that's how the GIL works.

>> The GIL can therefore make
>> it easier to write thread-safe code in Python, because you don't need
>> explicit locks for many uses of shared state.
>
> Locking a data state at script level does not scale anyway. A much
> better approach is to use message queues for communicating between threads.
>
>> You can certainly argue that the GIL was an unfortunate implementation
>> choice when Python was first created, and you can certainly argue that
>> relying on it in this way is questionable practice.  But there is plenty
>> of Python code that /does/ rely on it that way.
>
> This does not make this code right.
>

Of course. But saying the code is "not right", or at least "not written
as well as it should be" does not mean such code is not written and run
by many people.

>>
>> Standard practice for efficient Python coding is to avoid doing too much
>> hard work in pure Python.  Anything really time-consuming should be done
>> externally - such as OS calls, extension libraries for image processing,
>> databases, numpty, etc.  These all release the GIL before doing their
>> work, thus giving you good multi-threading performance.  It's only if
>> you are trying to do a lot of calculations or time-consuming work in
>> pure Python in multiple threads that the GIL is a problem.  And if
>> that's the case, you can usually use the "processing" library instead of
>> the "threading" library and get your multi-processing that way.
>
> All this "standard practice" is the consequence of the fact that Python
> does not support multithreading properly.
>

No - it is a consequence of Python being an interpreted and dynamic
language, emphasising flexibility and fast development over run-time
efficiency. Different languages have their strengths and weaknesses,
and run-time speed is not a strength of Python. Threading is an
irrelevant issue for a great deal of Python code. For example, modern
Python frameworks for server applications are often based on
asynchronous structures in the Python code. The underlying cpu
intensive (or network or disk intensive) work may be done in multiple
threads, but the Python code can be single-threaded asynchronous code.
The GIL or a lack of it makes no difference.

You can reasonably say that the popularity of the "processing" library
for some kind of work is a consequence of the GIL, as you get one GIL
per process and can thus do simultaneous work in the Python code.

Chris M. Thomasson

unread,
Feb 11, 2021, 4:36:48 PM2/11/21
to
On 2/11/2021 4:29 AM, Mr Flibble wrote:
>
> Hi!
>
> I am starting work on creating a new Python implementation from scratch
> using "neos" my universal compiler that can compile any programming
> language.  I envision this implementation to be significantly faster
> than the currently extant Python implementations (which isn't a stretch
> given how poorly they perform).
>
> Sample neos session (parsing a fibonacci program, neoscript rather than
> Python in this case):
[...]

Is this Python 3? If so, I have a program for you to test on it. Its a
sample implementation of my HMAC cipher. The code creates a test vector
for a sanity check against one of my C implementations. Here is my
Python 3 test vector code:

https://pastebin.com/raw/NAnsBJAZ

If everything is working correctly, you will get the following ciphertext:

72 3F 81 1F 5E B4 3D F4 E0 DD 50 CC 20 16 FF 8F
14 F5 31 37 14 31 35 F3 1C 99 EB 00 30 DA 44 CB
C6 AC E1 D9 BE 23 68 58 DE

Here is the C version:

https://pastebin.com/raw/feUnA3kP

(uncomment PYTHON_TEST_VECTOR to get the same ciphertext as the Python 3
test vector)

Afaict, it might be a good thing to test your Python impl against?

Chris M. Thomasson

unread,
Feb 11, 2021, 4:51:49 PM2/11/21
to
Funny that some Python 2 code does not work on Python 3. Always found
this to be rather odd.

Mr Flibble

unread,
Feb 11, 2021, 4:55:58 PM2/11/21
to
On 11/02/2021 21:36, Chris M. Thomasson wrote:
> On 2/11/2021 4:29 AM, Mr Flibble wrote:
>>
>> Hi!
>>
>> I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language.  I envision this implementation to be significantly faster than the currently extant Python implementations (which isn't a stretch given how poorly they perform).
>>
>> Sample neos session (parsing a fibonacci program, neoscript rather than Python in this case):
> [...]
>
> Is this Python 3? If so, I have a program for you to test on it. Its a sample implementation of my HMAC cipher. The code creates a test vector for a sanity check against one of my C implementations. Here is my Python 3 test vector code:
>
> https://pastebin.com/raw/NAnsBJAZ

"I am starting work on creating"

Be patient. :)

/Flibble

--
😎

Mr Flibble

unread,
Feb 11, 2021, 4:56:30 PM2/11/21
to
Not yet.

/Flibble

--
😎

Chris M. Thomasson

unread,
Feb 11, 2021, 5:07:21 PM2/11/21
to
Touche Mr Flibble! Sausages, damn it. :^)

However, imvvho, it might be a fairly decent thing to test your
implementation against. Since it must generate a specific output?

David Brown

unread,
Feb 12, 2021, 2:18:58 AM2/12/21
to
/Most/ Python 2 code does not work directly on Python 3 - amongst other
things, "print" was a statement in Python 2, and a function in Python 3.
There were lots of incompatibilities between Python 1.5 and Python 2 as
well, for those that remember that change (Python was not as popular at
that time). The Python "powers that be" consider it acceptable to make
breaking changes between major versions if the changes are a big enough
improvement or fix to the language. They draw the line in a very
different place from, for example, C - with C++ drawing their line
somewhere between these.

mick...@potatofield.co.uk

unread,
Feb 12, 2021, 6:46:00 AM2/12/21
to
On Thu, 11 Feb 2021 17:37:37 +0000
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>On 11/02/2021 15:46, mick...@potatofield.co.uk wrote:
>> On Thu, 11 Feb 2021 16:51:34 +0200
>> Paavo Helde <myfir...@osa.pri.ee> wrote:
>>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>>
>>>> Hi!
>>>>
>>>> I am starting work on creating a new Python implementation from scratch
>>>> using "neos" my universal compiler that can compile any programming
>>>> language.  I envision this implementation to be significantly faster
>>
>> Any? Hows it going with declarative languages such as SQL or Prolog then?
>
>Yes, any. Why do you feel the need to ask about declarative languages
>specifically?

Because beyond the lexical parser they don't break down into the same
execution structures as procedural languages. If you knew anything about
parsing you'd know that.

>> Or better yet forget threads and go multiprocess. If you're developing
>> on a proper OS anyway, on Windows the pain isn't worth it I imagine.
>
>You serious, bruv? Threads are essential.

Essential for what precisely? Specifically, what can they do that multiprocess
can't?

Mr Flibble

unread,
Feb 12, 2021, 9:52:15 AM2/12/21
to
On 12/02/2021 11:45, mick...@potatofield.co.uk wrote:
> On Thu, 11 Feb 2021 17:37:37 +0000
> Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>> On 11/02/2021 15:46, mick...@potatofield.co.uk wrote:
>>> On Thu, 11 Feb 2021 16:51:34 +0200
>>> Paavo Helde <myfir...@osa.pri.ee> wrote:
>>>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>>>
>>>>> Hi!
>>>>>
>>>>> I am starting work on creating a new Python implementation from scratch
>>>>> using "neos" my universal compiler that can compile any programming
>>>>> language.  I envision this implementation to be significantly faster
>>>
>>> Any? Hows it going with declarative languages such as SQL or Prolog then?
>>
>> Yes, any. Why do you feel the need to ask about declarative languages
>> specifically?
>
> Because beyond the lexical parser they don't break down into the same
> execution structures as procedural languages. If you knew anything about
> parsing you'd know that.

Why do you assume that I have no knowledge regarding declarative languages? Do you often make such assumptions when interacting with people you know fuck all about and their projects that you know fuck all about?

>
>>> Or better yet forget threads and go multiprocess. If you're developing
>>> on a proper OS anyway, on Windows the pain isn't worth it I imagine.
>>
>> You serious, bruv? Threads are essential.
>
> Essential for what precisely? Specifically, what can they do that multiprocess
> can't?

I am not in the habit of teaching ignorant, presumptive, arrogant cockwombles the fundamentals, dear.

/Flibble

--
😎

Mr Flibble

unread,
Feb 12, 2021, 9:53:18 AM2/12/21
to
This is why Python will not transition from "toy" status until it gets an ISO Standard.

/Flibble

--
😎

mick...@potatofield.co.uk

unread,
Feb 12, 2021, 10:26:34 AM2/12/21
to
On Fri, 12 Feb 2021 14:52:01 +0000
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>On 12/02/2021 11:45, mick...@potatofield.co.uk wrote:
>> Because beyond the lexical parser they don't break down into the same
>> execution structures as procedural languages. If you knew anything about
>> parsing you'd know that.
>
>Why do you assume that I have no knowledge regarding declarative languages? Do

Because you pretend you have a lot of knowledge about a lot of things but
when pressed you tend to come up short and resort to...

>you often make such assumptions when interacting with people you know fuck all
>about and their projects that you know fuck all about?

..answering questions with a question just like a 2nd rate politician.

So lets see an example of your wonder compiler compiling some SQL, Prolog or
other declarative language. I mean since its a universal compiler you'd have
done that, right?

>>> You serious, bruv? Threads are essential.
>>
>> Essential for what precisely? Specifically, what can they do that
>multiprocess
>> can't?
>
>I am not in the habit of teaching ignorant, presumptive, arrogant cockwombles
>the fundamentals, dear.

Another of your standard responses when you can't answer. But thanks for
playing son.

Mr Flibble

unread,
Feb 12, 2021, 11:04:17 AM2/12/21
to
On 12/02/2021 15:26, mick...@potatofield.co.uk wrote:
> On Fri, 12 Feb 2021 14:52:01 +0000
> Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>> On 12/02/2021 11:45, mick...@potatofield.co.uk wrote:
>>> Because beyond the lexical parser they don't break down into the same
>>> execution structures as procedural languages. If you knew anything about
>>> parsing you'd know that.
>>
>> Why do you assume that I have no knowledge regarding declarative languages? Do
>
> Because you pretend you have a lot of knowledge about a lot of things but
> when pressed you tend to come up short and resort to...

Assertions made without evidence can be dismissed with evidence.

>
>> you often make such assumptions when interacting with people you know fuck all
>> about and their projects that you know fuck all about?
>
> ..answering questions with a question just like a 2nd rate politician.
>
> So lets see an example of your wonder compiler compiling some SQL, Prolog or
> other declarative language. I mean since its a universal compiler you'd have
> done that, right?

Since when is SQL ever "compiled"?

>
>>>> You serious, bruv? Threads are essential.
>>>
>>> Essential for what precisely? Specifically, what can they do that
>> multiprocess
>>> can't?
>>
>> I am not in the habit of teaching ignorant, presumptive, arrogant cockwombles
>> the fundamentals, dear.
>
> Another of your standard responses when you can't answer. But thanks for
> playing son.

I don't believe I have ever responded with those exact words before, dear, ergo it cannot be one of my "standard" responses.

If you want to learn about threads then I suggest you go back to school, dear.

/Flibble

--
😎

mick...@potatofield.co.uk

unread,
Feb 12, 2021, 11:20:43 AM2/12/21
to
On Fri, 12 Feb 2021 16:04:05 +0000
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>On 12/02/2021 15:26, mick...@potatofield.co.uk wrote:
>> On Fri, 12 Feb 2021 14:52:01 +0000
>> Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>>> On 12/02/2021 11:45, mick...@potatofield.co.uk wrote:
>>>> Because beyond the lexical parser they don't break down into the same
>>>> execution structures as procedural languages. If you knew anything about
>>>> parsing you'd know that.
>>>
>>> Why do you assume that I have no knowledge regarding declarative languages?
>Do
>>
>> Because you pretend you have a lot of knowledge about a lot of things but
>> when pressed you tend to come up short and resort to...
>
>Assertions made without evidence can be dismissed with evidence.

So prove me wrong.

>> So lets see an example of your wonder compiler compiling some SQL, Prolog or
>> other declarative language. I mean since its a universal compiler you'd have
>> done that, right?
>
>Since when is SQL ever "compiled"?

Oh I dunno, probably since the 1980s. Or do you think RDBMs store procedures
as plain text then parse them each time?

>>> I am not in the habit of teaching ignorant, presumptive, arrogant
>cockwombles
>>> the fundamentals, dear.
>>
>> Another of your standard responses when you can't answer. But thanks for
>> playing son.
>
>I don't believe I have ever responded with those exact words before, dear,
>ergo it cannot be one of my "standard" responses.
>
>If you want to learn about threads then I suggest you go back to school, dear.

I've been fully versed in threads for 2 decades buttercup and I've yet to
see anything they can do that multiprocess can't though mileage may vary for
each depending on the use case. However I'm speaking from a unix POV. I guess
if you've only programmed on a toy OS like Windows that can even do something
as fundamental as multiplexing network sockets without threading then I guess
you may well be screwed without them.

Mr Flibble

unread,
Feb 12, 2021, 11:33:22 AM2/12/21
to
It is "UNIX" not "unix", dear. And as far as UNIX-like is concerned: Linux's overcommit/OOM-killer to support fork()ing is a fucking omnishambles; but you wouldn't know this of course as you are fucking clueless anachronism.

If you knew anything useful about threads you would know what advantages they have over processes; I repeat: go back to school, dear.

/Flibble

--
😎

mick...@potatofield.co.uk

unread,
Feb 12, 2021, 12:12:41 PM2/12/21
to
On Fri, 12 Feb 2021 16:33:09 +0000
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>On 12/02/2021 16:20, mick...@potatofield.co.uk wrote:

Still waiting for your proof. Take your time.

>> if you've only programmed on a toy OS like Windows that can even do something
>
>> as fundamental as multiplexing network sockets without threading then I guess
>
>> you may well be screwed without them.
>
>It is "UNIX" not "unix", dear. And as far as UNIX-like is concerned: Linux's
>overcommit/OOM-killer to support fork()ing is a fucking omnishambles; but you
>wouldn't know this of course as you are fucking clueless anachronism.

Oh dear, someone tell the child about copy-on-write.

If you're going to google stuff and pretend its your own knowledge you might
want to have a clue first. FWIW overcommit is pretty standard amongst OS's of
all colours and has been for decades.

>If you knew anything useful about threads you would know what advantages they
>have over processes; I repeat: go back to school, dear.

Thanks for proving my point. Have a good w/e with your boyfriend cupcake.

Scott Lurndal

unread,
Feb 12, 2021, 1:19:13 PM2/12/21
to
mick...@potatofield.co.uk writes:
>On Fri, 12 Feb 2021 16:33:09 +0000
>Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>>On 12/02/2021 16:20, mick...@potatofield.co.uk wrote:
>
>Still waiting for your proof. Take your time.
>
>>> if you've only programmed on a toy OS like Windows that can even do something
>>
>>> as fundamental as multiplexing network sockets without threading then I guess
>>
>>> you may well be screwed without them.
>>
>>It is "UNIX" not "unix", dear. And as far as UNIX-like is concerned: Linux's
>>overcommit/OOM-killer to support fork()ing is a fucking omnishambles; but you
>>wouldn't know this of course as you are fucking clueless anachronism.
>
>Oh dear, someone tell the child about copy-on-write.

copy-on-write and overcommit are two orthogonal concepts.

That said, linux allows one to disable overcommit quite easily.

Chris M. Thomasson

unread,
Feb 12, 2021, 4:08:50 PM2/12/21
to
Are you familiar with IOCP?

Mr Flibble

unread,
Feb 12, 2021, 5:22:52 PM2/12/21
to
On 12/02/2021 17:12, mick...@potatofield.co.uk wrote:
> On Fri, 12 Feb 2021 16:33:09 +0000
> Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>> On 12/02/2021 16:20, mick...@potatofield.co.uk wrote:
>
> Still waiting for your proof. Take your time.

Proof of what, dear?

>
>>> if you've only programmed on a toy OS like Windows that can even do something
>>
>>> as fundamental as multiplexing network sockets without threading then I guess
>>
>>> you may well be screwed without them.
>>
>> It is "UNIX" not "unix", dear. And as far as UNIX-like is concerned: Linux's
>> overcommit/OOM-killer to support fork()ing is a fucking omnishambles; but you
>> wouldn't know this of course as you are fucking clueless anachronism.
>
> Oh dear, someone tell the child about copy-on-write.

The problem, dear, is when lots of processes start "copy-on-writing" causing over-committed pages to be allocated you run out of memory and Linux starts killing random processes. This is the omnishambles, dear.

> If you're going to google stuff and pretend its your own knowledge you might
> want to have a clue first. FWIW overcommit is pretty standard amongst OS's of
> all colours and has been for decades.

I haven't googled anything, dear. Perhaps you have and are trying to misdirect? Unsuccessfully?

>
>> If you knew anything useful about threads you would know what advantages they
>> have over processes; I repeat: go back to school, dear.
>
> Thanks for proving my point. Have a good w/e with your boyfriend cupcake.

You don't appear to have any points of interest, dear.

/Flibble

--
😎

mick...@potatofield.co.uk

unread,
Feb 13, 2021, 5:34:36 AM2/13/21
to
They're really not.


mick...@potatofield.co.uk

unread,
Feb 13, 2021, 5:38:35 AM2/13/21
to
Nope, but having skim read about it I don't see anything there that multi
process couldn't accomplish. If you know otherwise then feel free to explain.

mick...@potatofield.co.uk

unread,
Feb 13, 2021, 5:42:30 AM2/13/21
to
On Fri, 12 Feb 2021 22:22:41 +0000
Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>On 12/02/2021 17:12, mick...@potatofield.co.uk wrote:
>> On Fri, 12 Feb 2021 16:33:09 +0000
>> Mr Flibble <fli...@i42.REMOVETHISBIT.co.uk> wrote:
>>> On 12/02/2021 16:20, mick...@potatofield.co.uk wrote:
>>
>> Still waiting for your proof. Take your time.
>
>Proof of what, dear?

Is the thread getting too complex for you too follow? Go have a lie down.

>> Oh dear, someone tell the child about copy-on-write.
>
>The problem, dear, is when lots of processes start "copy-on-writing" causing
>over-committed pages to be allocated you run out of memory and Linux starts
>killing random processes. This is the omnishambles, dear.

Well as someone else said, you can switch over commit off if its an issue and
at least *nix does it page by page rather than the MS option of "Lets load
an entirely new copy of an exe into memory and start executing it from the
beginning with little parental state". Very useful. The irony of course is
that the WIndows kernel can do fork but for [reasons] MS doesn't expose it
in the Win32 API.

Chris M. Thomasson

unread,
Feb 13, 2021, 3:53:07 PM2/13/21
to
IOCP is basically windows version of POSIX aio. Just make sure to never
create a process and/or thread per connection. That really, really bad.

mick...@potatofield.co.uk

unread,
Feb 15, 2021, 4:34:20 AM2/15/21
to
On Sat, 13 Feb 2021 12:52:50 -0800
"Chris M. Thomasson" <chris.m.t...@gmail.com> wrote:
>On 2/13/2021 2:38 AM, mick...@potatofield.co.uk wrote:
>> On Fri, 12 Feb 2021 13:08:32 -0800
>> "Chris M. Thomasson" <chris.m.t...@gmail.com> wrote:
>>> On 2/12/2021 8:20 AM, mick...@potatofield.co.uk wrote:
>>>> if you've only programmed on a toy OS like Windows that can even do
>something
>>>
>>>> as fundamental as multiplexing network sockets without threading then I
>guess
>>>
>>>> you may well be screwed without them.
>>>>
>>>
>>> Are you familiar with IOCP?
>>
>> Nope, but having skim read about it I don't see anything there that multi
>> process couldn't accomplish. If you know otherwise then feel free to explain.
>
>>
>
>IOCP is basically windows version of POSIX aio. Just make sure to never
>create a process and/or thread per connection. That really, really bad.

I guess that depends on how long many connections you're expecting per unit
time, how long they stay up and how important the server is. I wrote a
middleware system that forked every time a new connection came but but we only
expected a few connections a minute and they'd stay up for 2-3 mins at a time.
Plus it was a critical system and if the main process went down the company
backend would grind to a halt so multiplexing and threading were off the table.

Kenny McCormack

unread,
Feb 18, 2021, 5:10:01 PM2/18/21
to
In article <87r1lmc...@bsb.me.uk>,
Incidentally, if neos actually did what is claimed, there would be no need
for a "new Python implementation from scratch", since neos could, in and of
itself, compile Python source code.

I.e., the simple existence of neos would obviate the need to ever implement
any language, ever again, for all time.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/LadyChatterley

Cholo Lennon

unread,
Feb 18, 2021, 11:15:25 PM2/18/21
to
On 2/11/21 2:13 PM, David Brown wrote:
> On 11/02/2021 15:51, Paavo Helde wrote:
>> 11.02.2021 14:29 Mr Flibble kirjutas:
>>>
>>> Hi!
>>>
>>> I am starting work on creating a new Python implementation from
>>> scratch using "neos" my universal compiler that can compile any
>>> programming language.  I envision this implementation to be
>>> significantly faster than the currently extant Python implementations
>>> (which isn't a stretch given how poorly they perform).
>>
>> Could you please take care to have it properly multithreadable? A GIL
>> lock is not something worth to replicate. A good principle would be to
>> have no global static state at all.
>
> Removing the GIL always sounds like a great idea, but remember it would
> make a lot of Python code incompatible. Some people writing Python code
> will assume that certain operations - assignment being a key example -
> are atomic and safe to do in threaded code. The GIL can therefore make
> it easier to write thread-safe code in Python, because you don't need
> explicit locks for many uses of shared state.

Yes, you're right, a lot of code rely on GIL behavior. That is why they
still haven't figured out how to remove it painlessly. For sure it will
never be removed, unless a new incompatible version (4 maybe) take care
of it.

Years ago, in order to overcome the multi-thread limitations of Python,
I managed to run my load simulator (for a specific telecommunication
protocol) in Jython 2.7 without any problem. The improve in performance
was huge. It's known that that particular implementation of Python
doesn't have a GIL because of the underlying JVM.
Of course it worked for me, but I don't know how many Python 2.7
applications can run under Jython, not only because they rely on GIL,
but also because they use a lot libraries that are natively implemented
(which in turn, can also rely on GIL). Unfortunately Jython 3.x does not
exist yet.

Regards.

--
Cholo Lennon
Bs.As.
ARG

Chris M. Thomasson

unread,
Feb 23, 2021, 12:08:57 AM2/23/21
to
I have seen cases where the server created a thread-per-connection and
all was well... Until more and more users started using it!

mick...@potatofield.co.uk

unread,
Feb 23, 2021, 4:18:52 AM2/23/21
to
The big achilles heal of multithreaded systems is that if 1 thread crashes
it brings down the entire system. Thats really not something you want if its
mission critical.

Chris M. Thomasson

unread,
Feb 23, 2021, 4:26:37 AM2/23/21
to
Your are correct... Therefore one should have multiple processes, and
multiple threads within each process. Thank you for making me remember
various setups I have coded:

1 process per cpu

multiple threaders per process for the cores in the cpu.


Then you can get more coarse/fine grain:

process per cpu, bound to it.

core child process per core on target bound cpu, bound

hyper threaded threads per-core child process.

fibers in threads? Na...


ect...


Your are 100% correct that a single thread going down should NOT off the
system/server. Your are right. Multiple processes needed.

Chris M. Thomasson

unread,
Feb 23, 2021, 4:28:18 AM2/23/21
to
On 2/23/2021 1:26 AM, Chris M. Thomasson wrote:
> On 2/23/2021 1:18 AM, mick...@potatofield.co.uk wrote:
>> On Mon, 22 Feb 2021 21:08:43 -0800
>> "Chris M. Thomasson" <chris.m.t...@gmail.com> wrote:
>>> On 2/15/2021 1:34 AM, mick...@potatofield.co.uk wrote:
[...]
> Your are 100% correct that a single thread going down should NOT off the
> system/server. Your are right. Multiple processes needed.


Your means You are. Sorry.

mick...@potatofield.co.uk

unread,
Feb 23, 2021, 6:50:42 AM2/23/21
to
On Tue, 23 Feb 2021 01:26:22 -0800
"Chris M. Thomasson" <chris.m.t...@gmail.com> wrote:
>On 2/23/2021 1:18 AM, mick...@potatofield.co.uk wrote:
>> On Mon, 22 Feb 2021 21:08:43 -0800
>> "Chris M. Thomasson" <chris.m.t...@gmail.com> wrote:
>>> I have seen cases where the server created a thread-per-connection and
>>> all was well... Until more and more users started using it!
>>
>> The big achilles heal of multithreaded systems is that if 1 thread crashes
>> it brings down the entire system. Thats really not something you want if its
>> mission critical.
>>
>
>Your are correct... Therefore one should have multiple processes, and
>multiple threads within each process. Thank you for making me remember
>various setups I have coded:

Yes, thats certainly an approach I've seen a lot. Of course marshalling both
processes and threads can be a difficult task and programmers who are well
versed in both multithreaded and multiprocess development are not as common as
they should be.

Scott Lurndal

unread,
Feb 23, 2021, 9:59:21 AM2/23/21
to
Your premise is faulty.

mick...@potatofield.co.uk

unread,
Feb 23, 2021, 10:19:41 AM2/23/21
to
No, it isn't.

Scott Lurndal

unread,
Feb 23, 2021, 11:20:43 AM2/23/21
to
Any modern operating system is multithreaded. They recover just fine
when "1 thread crashes". Ipso facto.

mick...@potatofield.co.uk

unread,
Feb 23, 2021, 11:44:56 AM2/23/21
to
On Tue, 23 Feb 2021 16:20:27 GMT
If you're talking about the OS kernel, no, they don't always recover just fine
if something goes wrong. Its called a Kernel panic or blue screen in Windows.
However the OS controls what happens with itself, user processes have limited
control over what the OS does to them when they page fault or similar.

HTH.

Scott Lurndal

unread,
Feb 23, 2021, 12:34:17 PM2/23/21
to
mick...@potatofield.co.uk writes:
>On Tue, 23 Feb 2021 16:20:27 GMT
>sc...@slp53.sl.home (Scott Lurndal) wrote:

>>>>Your premise is faulty.
>>>
>>>No, it isn't.
>>
>>Any modern operating system is multithreaded. They recover just fine
>>when "1 thread crashes". Ipso facto.
>
>If you're talking about the OS kernel, no, they don't always recover just fine
>if something goes wrong. Its called a Kernel panic or blue screen in Windows.

Windows is hardly an exemplar of operating system design. I've been
writing operating systems for four decades, and I stand by my assertion.

>However the OS controls what happens with itself, user processes have limited
>control over what the OS does to them when they page fault or similar.

It is quite possible for applications to be quite resiliant, when using
real operating systems. Tandem non-stop comes to mind, and they're still
chugging away (HPE).

Chris M. Thomasson

unread,
Feb 23, 2021, 2:26:08 PM2/23/21
to
In user space, when a thread in a process crashes, it brings the whole
process down.

Chris M. Thomasson

unread,
Feb 23, 2021, 2:26:50 PM2/23/21
to
Well, that has been my experience.

Chris M. Thomasson

unread,
Feb 23, 2021, 2:28:49 PM2/23/21
to
Indeed! This brings to mind so-called robust mutexes. I have used to use
them to detect when a process dies while holding something critical
shared between processes. Windows and POSIX has them.

mick...@potatofield.co.uk

unread,
Feb 24, 2021, 4:23:35 AM2/24/21
to
On Tue, 23 Feb 2021 17:34:00 GMT
sc...@slp53.sl.home (Scott Lurndal) wrote:
>mick...@potatofield.co.uk writes:
>>On Tue, 23 Feb 2021 16:20:27 GMT
>>sc...@slp53.sl.home (Scott Lurndal) wrote:
>
>>>>>Your premise is faulty.
>>>>
>>>>No, it isn't.
>>>
>>>Any modern operating system is multithreaded. They recover just fine
>>>when "1 thread crashes". Ipso facto.
>>
>>If you're talking about the OS kernel, no, they don't always recover just fine
>
>>if something goes wrong. Its called a Kernel panic or blue screen in Windows.
>
>Windows is hardly an exemplar of operating system design. I've been
>writing operating systems for four decades, and I stand by my assertion.

I was thinking of *nix mainly, my Windows dev experience is limited.

>>However the OS controls what happens with itself, user processes have limited
>>control over what the OS does to them when they page fault or similar.
>
>It is quite possible for applications to be quite resiliant, when using
>real operating systems. Tandem non-stop comes to mind, and they're still
>chugging away (HPE).

Tandem was a specialist OS and will probably diverge from common OS's in how
threads and processes are demarcated. Anyway, the non-stop part is referring to
the OS maintaining the processes if some hardware goes down, not keeping them
alive if the process itself crashes.

Alf P. Steinbach

unread,
Feb 24, 2021, 11:17:15 AM2/24/21
to
On 11.02.2021 13:29, Mr Flibble wrote:
>
>
> I am starting work on creating a new Python implementation from scratch
[snip]

Possibly relevant: the Julia programming language, e.g. see
https://www.nature.com/articles/d41586-019-02310-3

- Alf

mick...@potatofield.co.uk

unread,
Feb 24, 2021, 12:02:04 PM2/24/21
to
On Wed, 24 Feb 2021 17:16:59 +0100
"Alf P. Steinbach" <alf.p.stein...@gmail.com> wrote:
>On 11.02.2021 13:29, Mr Flibble wrote:
>>
>>
>> I am starting work on creating a new Python implementation from scratch
>[snip]

I missed that recent bit of bullshittery from the groups resident comedian.
There needs to be a new category beyond vapourware for his software,
perhaps Heisenbergware to go along with Heisenbugs - when you look for it it
magically vanishes.

0 new messages