Hi, folks! We need your advice on organizing the standard library. This is the first time we ask to brainstorm for a particular improvement. I hope XOD and you would benefit from it.
Well, we have xod/core
library and it starts to become a pile of trash which is hard to navigate and explore. Some xoders already asked to categorize the nodes. Let’s do it. The idea is to evaporate xod/core
completely by moving its nodes to new libraries.
Question 1: How many libraries should we have instead of single xod/core
Now, 110 nodes are in the development version of XOD. The number will grow, but it’s likely it would stay at the order of hundreds magnitude for a long time. If the categorization should improve search time, the best theoretical results should we achieved when N_cat = sqrt(N_nodes). I.e. the current optimum is ten categories (libraries) or so.
Feel free to comment if you have other thoughts.
Question 2: What are these new libraries?
Here is a proposal:
Node name New path
absolute xod/math/abs
acos xod/math/acos
add xod/math/add
analoginput xod/io/analoginput
and xod/logic/and
any xod/control/any
asin xod/math/asin
atan xod/math/atan
boot xod/time/boot
buffer xod/control/buffer
castbooleantonumber xod/logic/tozeroone
castbooleantopulse  should rely on pulseontrue
castbooleantostring xod/text/formatboolean
castnumbertoboolean xod/logic/nonzero
castnumbertostring  should rely on xod/text/formatnumber
ceil xod/math/ceil
clip xod/math/clip
clock xod/time/clock
concat xod/list/concat
concat3  [1]
concat4  [1]
concat5  [1]
concat6  [1]
consolelog xod/debug/consolelog
constantboolean xod/core/constant
constantnumber  [2]
constantstring  [2]
constrain xod/math/constrain
continuously xod/time/continuously
continuouslypausable  should be merged into `continuously`
cos xod/math/cos
count xod/control/count
cube xod/math/cube
debounceboolean xod/time/debounce
deferboolean xod/control/defer
defernumber  [2]
deferpulse  [2]
deferstring  [2]
delay xod/time/delay
digitalinput xod/io/digitalinput
digitaloutput xod/io/digitaloutput
discretize2 xod/math/discretize
discretize3  [2]
discretize4  [2]
divide xod/math/divide
dutytotime xod/time/dutytotime
equal xod/math/equal
fade xod/control/fade
flipflop xod/control/flipflop
flipntimes xod/time/flipntimes
floor xod/math/floor
formatnumber xod/text/formatnumber
gate xod/control/gate
gateboolean  [2]
gatenumber  [2]
gatepulse  [2]
gatestring  [2]
greater xod/math/greater
i2cbegintransmission xod/io/i2cbegintransmission
i2cendtransmission xod/io/i2cendtransmission
i2cread xod/io/i2cread
i2crequest xod/io/i2crequest
i2crequestbytes6 xod/io/i2cfetchpacket
i2csendbyte xod/io/i2csendpacket
i2csendbytes2  [1]
i2cwrite xod/io/i2cwrite
ifelse xod/logic/ifelse
ifelsestring  [2]
less xod/math/less
log10 xod/math/log10
logbx xod/math/logbx
loge xod/math/loge
mapcliprange xod/math/mapclip
maprange xod/math/map
modulo xod/math/modulo
multiply xod/math/multiply
nand xod/logic/nand
nor xod/logic/nor
not xod/logic/not
nthnumber2 xod/list/nth
nthnumber3  [2]
nthnumber4  [2]
or xod/logic/or
pi xod/math/pi
pow xod/math/pow
pulseonchange xod/control/pulseonchange
pulseonfalse xod/control/pulseonfalse
pulseontrue xod/control/pulseontrue
pwmoutput xod/io/pwmoutput
round xod/math/round
sawwave xod/time/sawwave
sawwavemap xod/math/mapsaw
select xod/control/select
sin xod/math/sin
sinewave xod/time/sinewave
sinewavemap xod/math/mapsin
sqrt xod/math/sqrt
square xod/math/square
squarewave xod/time/squarewave
subtract xod/math/subtract
systemtime xod/time/time
tan xod/math/tan
timetoduty xod/time/timetoduty
timer xod/time/timer
topercent xod/text/topercent
triwave xod/time/triwave
triwavemap xod/math/maptri
watch xod/debug/watch
wordtonumber xod/bits/wordtonumber
xor xod/logic/xor
¹ Arity would be eradicated in future versions by using lists
² Nodes that differ only in types would be generalized using generic types in future versions
If we’d sort the list above by the new path column and remove the nodes which should go:
Node name New path
wordtonumber xod/bits/wordtonumber
any xod/control/any
buffer xod/control/buffer
count xod/control/count
deferboolean xod/control/defer
fade xod/control/fade
flipflop xod/control/flipflop
gate xod/control/gate
pulseonchange xod/control/pulseonchange
pulseonfalse xod/control/pulseonfalse
pulseontrue xod/control/pulseontrue
select xod/control/select
constantboolean xod/core/constant
consolelog xod/debug/consolelog
watch xod/debug/watch
analoginput xod/io/analoginput
digitalinput xod/io/digitalinput
digitaloutput xod/io/digitaloutput
i2cbegintransmission xod/io/i2cbegintransmission
i2cendtransmission xod/io/i2cendtransmission
i2crequestbytes6 xod/io/i2cfetchpacket
i2cread xod/io/i2cread
i2crequest xod/io/i2crequest
i2csendbyte xod/io/i2csendpacket
i2cwrite xod/io/i2cwrite
pwmoutput xod/io/pwmoutput
concat xod/list/concat
nthnumber2 xod/list/nth
and xod/logic/and
ifelse xod/logic/ifelse
nand xod/logic/nand
castnumbertoboolean xod/logic/nonzero
nor xod/logic/nor
not xod/logic/not
or xod/logic/or
castbooleantonumber xod/logic/tozeroone
xor xod/logic/xor
absolute xod/math/abs
acos xod/math/acos
add xod/math/add
asin xod/math/asin
atan xod/math/atan
ceil xod/math/ceil
clip xod/math/clip
constrain xod/math/constrain
cos xod/math/cos
cube xod/math/cube
discretize2 xod/math/discretize
divide xod/math/divide
equal xod/math/equal
floor xod/math/floor
greater xod/math/greater
less xod/math/less
log10 xod/math/log10
logbx xod/math/logbx
loge xod/math/loge
maprange xod/math/map
mapcliprange xod/math/mapclip
sawwavemap xod/math/mapsaw
sinewavemap xod/math/mapsin
triwavemap xod/math/maptri
modulo xod/math/modulo
multiply xod/math/multiply
pi xod/math/pi
pow xod/math/pow
round xod/math/round
sin xod/math/sin
sqrt xod/math/sqrt
square xod/math/square
subtract xod/math/subtract
tan xod/math/tan
castbooleantostring xod/text/formatboolean
formatnumber xod/text/formatnumber
topercent xod/text/topercent
boot xod/time/boot
clock xod/time/clock
continuously xod/time/continuously
debounceboolean xod/time/debounce
delay xod/time/delay
dutytotime xod/time/dutytotime
flipntimes xod/time/flipntimes
sawwave xod/time/sawwave
sinewave xod/time/sinewave
squarewave xod/time/squarewave
systemtime xod/time/time
timetoduty xod/time/timetoduty
timer xod/time/timer
triwave xod/time/triwave
So, we have nine libraries:

xod/bits
— bitwise operations, bit shifts, bit masks, lowlevel data packing 
xod/control
— the nodes to store the state and control the execution flow 
xod/debug
— nodes to monitor the program, set breakpoints, adjust parameters 
xod/io
— very basic hardwarenative input and output 
xod/lists
— operations on vectors/lists 
xod/logic
— boolean operations 
xod/math
— the algebra from a school 
xod/text
— operations on strings of text 
xod/time
— timesignal generators
Does it looks OK?
Question 3: Does xod/control
looks like a new pile?
Intuitively I feel when a node should fall into a particular lib. But that’s not a case for xod/control
. Can someone suggest an alternative or a strong metaphor?
BTW, should debounce
and delay
belong to time
or they should be in control
?
Question 4: Where we should put the constant
node?
There’s no xod/core
anymore, it lost the home One solution is to have something called xod/atoms
instead of current xod/patchnodes
and put it there. Is it OK?
Question 5: Should we use widely adopted abbreviations for names?

divide
→div

subtract
→sub

multiply
→mul

absolute
→abs
If so, where should we stop?

modulo
→mod
? 
constant
→const
? 
greater
→gt
? 
time
→t
? 
i2csendpacket
→i2csndpk
?
Looking forward for your thoughts!