« first day (35 days earlier)      last day (686 days later) » 

5:03 AM
@lyxal can i delte cli-repl
the branch
 
sure
 
ok heres is my idea for glyphs:
nilads: subscripts symbols
monads: capital letters / letters from other languages (greek, cryllic etc)
dyads: small letters / symbols
quicks: superscript symbols
i am going to make a change-glyphs branch
@lyxal how is the idea ^^
 
good
 
imma copy glyphs from BQN/APL :)
 
5:30 AM
    "₀": attrdict(arity=0, call=lambda: 100),
    "₁": attrdict(arity=0, call=lambda: [0, 1]),
    "₂": attrdict(arity=0, call=lambda: 10),
    "₃": attrdict(arity=0, call=lambda: sys.argv[1] if len(sys.argv) > 1 else 16),
    "₄": attrdict(arity=0, call=lambda: sys.argv[2] if len(sys.argv) > 2 else 32),
    "₅": attrdict(arity=0, call=lambda: sys.argv[3] if len(sys.argv) > 3 else 64),
    "₆": attrdict(arity=0, call=lambda: 0),
    "₈": attrdict(arity=0, call=lambda: ord(sys.stdin.read(1))),
    "₉": attrdict(arity=0, call=lambda: [ord(c) for c in input()]),
haha lol wow @lyxal ^
 
Beautiful
 
i also have an idea if i need to implement flax in C++
also uh for monads i can only use uppercase letters and letters from greek etc
should i change that cause i see:
    "!": attrdict(arity=1, call=vectorised(factorial)),
    "¬": attrdict(arity=1, call=vectorised(lambda a: 1 if not a else 0)),
    "~": attrdict(arity=1, call=vectorised(lambda a: ~a)),
 
No those symbols make sense
 
ok
    "Π": attrdict(arity=1, call=lambda x: foldl1(op.mul, flatten(x))),
    "Σ": attrdict(arity=1, call=lambda x: sum(flatten(x))),
^ change them?
or no?
@lyxal should range vectorise?
@lyxal Jelly uses 1 based indexing
should flax use 0 based indexing?
in The APL Orchard, Dec 30 '21 at 10:52, by Adám
@PyGamer0 APL originally had only 1 due to being mathematical in nature (cf. Mathematica, MatLab, R, Julia, …) but it turned out suboptimal for some domains, and a choice was introduced. Didn't take long before people realised that a choice is worse than a suboptimal standard, and J (which didn't need backwards compatibility) chose 0.
CMP: should flax use 0 based indexing?
CMQ: Should Range vectorise?
 
5:51 AM
0 is good
Range should vectorise
 
ok
finally a major diversion from jelly
not including other things :p
@lyxal ok then now how useful is 1...n range?
 
useful enough that it's in vyxal
 
examples?
 
@PyGamer0 it's everywhere
literally everywhere
 
6:06 AM
BQN doesnt have it :P
 
@PyGamer0 bqn isn't a bleeding golfing language
and when i mean "Everywhere" i mean in questions
 
yeah the array languages are all practical
@Razetime should i add you as a collaborator?
 
well what should i be contributing
 
\_(○_○)_/
 
if I have something to do on the repo you should add me
 
6:12 AM
ok
well technically i am doing everyhting
    "ᵇ": attrdict(arity=1, call=vectorised(lambda a: a % 2)),
ok i guess i can replace with
    "Θ": attrdict(arity=1, call=lambda x: iterable(x, make_range=True).insert(0, 0)),
uh
10Θ→[0,0,1,2,3,4,5,6,7,8,9]
lol what
 
looks like it does exactly what you tell it to do
although looking at the definition of iterable, tf?
 
and if i run it in the repl it errors lmao
AttributeError: 'NoneType' object has no attribute 'xreplace'
 
then search for xreplace in your folder
 
no its from sympy
ill see what is the problem
 
do you have a debug mode for your interpreter
 
6:26 AM
like?
wdym
 
like when you run the interpreter there is a flag that you can use
 
no
 
which prints the stack every time a command is called
your golflang is in the early stage so make debugging easier now
 
stack?
 
oh yeah nvm
just prints the ast and what is going into each atom
 
6:28 AM
ok
uh did vectorisation break
because of sympy?
      10⍳+1
>
>
Traceback (most recent call last):
  File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\ru
npy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\b\AppData\Local\Programs\Python\Python310\lib\ru
npy.py", line 86, in _run_code
    exec(code, run_globals)
  File "c:\Users\c\Desktop\stuff\flax\flax\__main__.py", line 19,
 in <module>
    cli_repl()
  File "c:\Users\d\Desktop\stuff\flax\flax\main.py", line 31, in
cli_repl
    flax_print(variadic_chain(chain, *args))
this is dumb
what if i remove sympy
 
go ahead
wait what do you use it for
rational number type?
 
yes
 
you'll have to manually implement a rational type then
 
hmmmmmmmmMMMMMM
@Razetime i think i implemented a debug flag
 
6:44 AM
cool
good job
 
and for some reason now it works lol
what it fixed itself
I am confused
 
bruh
 
      10I
>
>
range(0 10)
sympy
why
 
i mean
not very surprising
sympy works on symbolic math
 
why does it do that
 
6:46 AM
you have to always change things back to ordinary stuff
i hope you have read at least one sympy tutorial?
 
yes
i have read atleast one
actually i read liitledocs
ok what tf
WTF
@Razetime this is random, one time 10I+1 works the other time it errors
and similarly 10I works other times it range(0 10)
@lyxal ^
ill go take a break
 
@PyGamer0 how can it be nondeterministic if the operation is deterministic
have you pushed the changes that cause this? I wanna try it out
 
@Razetime pushed
its in the glyphs branch
 
so i need to clone the glyphs branch?
 
or checkout to it
 
7:00 AM
ah yeah
what are the running instructions
 
i run it like: python -m flax
and for debugging: python -m flax d
i think it doesnt error when debugging
 
from which directory
flax/?
 
yes
but i guess i can do that from anywhere
 
$ python -m flax
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/razetime/Documents/Code/fun/flax/flax/__main__.py", line 3, in <module>
    from prompt_toolkit import print_formatted_text as pft, HTML
ModuleNotFoundError: No module named 'prompt_toolkit'
 
oh poetry install?
then python -m flax
 
7:08 AM
you really need some build instructions from scratch
:60277505 $ poetry install
The currently activated Python version 3.8.10 is not supported by the project (>3.9).
Trying to find and use a compatible version.
Using python3.10 (3.10.2)
Creating virtualenv flax-YjccEFaI-py3.10 in /home/razetime/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

  SolverProblemError

  Because flax depends on sympy (*) which doesn't match any versions, version solving failed.
 
hm poetry update?
 
    File "/home/razetime/.cache/pypoetry/virtualenvs/flax-YjccEFaI-py3.10/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 13, in <module>
      from pip._internal.utils.misc import ensure_dir
    File "/home/razetime/.cache/pypoetry/virtualenvs/flax-YjccEFaI-py3.10/lib/python3.10/site-packages/pip/_internal/utils/misc.py", line 40, in <module>
      from pip._internal.locations import get_major_minor_version, site_packages, user_site
    File "/home/razetime/.cache/pypoetry/virtualenvs/flax-YjccEFaI-py3.10/lib/python3.10/site-packages/pip/_internal/locations/__init__.py",
 
○_○
 
i dunno what's causing this
 
even me
 
7:22 AM
what is your python version
 
can you remove the poetry.lock and try poetry install again?
@Razetime 3.10.0
 
ok same
@PyGamer0 same modulenotfound error
 
manually install the dependencies?
pip install sympy prompt_toolkit pyhof more_itertools
 
ugh
ok it works
so
$ python -m flax
flax REPL version 0.1.0
      10I
>
>
[0 1 2 3 4 5 6 7 8 9]
      10I
>
>
range(0 10)
      10I
>
>
range(0 10)
      10I
>
>
range(0 10)
      10I
>
>
range(0 10)
see a pattern here?
after the first run it seems to always return range(1 10)
And it always does this
so you're doing something wrong where I is messing up after first time it's used
 
hm ok
i pushed a potential fix
it works on my machine
 
7:29 AM
what was the problem
 
ah the joys of using custom libraries
@Razetime pyhof
 
aha
 
apparently compose(list, range) refused to work
ill keep sympy
and remove pyhof
 
why?
pyhof is made for your convenience
in fact you should patch pyhof to make sure that this works
I would recommend lambda x: list(range(x)) rather than [*range(x)]
 
why?
 
7:32 AM
because it's more readable
 
ok
 
[*range(x)] is best kept within golfing
 
ok
ah the range(0, 10) problem is with pyhof
ill fix it later ○/
 
7:49 AM
@PyGamer0 the problem is because of janky iterator behaviour inside wrapped functions
I'm working on a fix and a way to better describe it
But deepsource might give a better description
 
where are you fixing it? pyhof?
 
Yes
I'm running an analysis now
 
ok
 
Huh, deepsource doesn't have a term for what I suspect is happening
But basically, the first time you call a composed function, it has all the functions in func
The second time you call it though, there's no function in funcs
Because funcs has been exhausted because it's a generator
I'll or a
I'll pr a fix later
 
compose looks like it has an easy recursive definition
 
7:58 AM
@lyxal oh a generatoelr
 
maybe that is my haskell self showing up
 
oh i totally forgot to install haskell lol
 
8:14 AM
@Razetime you could also just reduce by 2 function composition
 
@lyxal ah yeah pretty much
 
Use the higher order function stuff to construct the higher order function stuff
 
8:32 AM
@Razetime @lyxal ^ does that work?
 
have you run it
 
I think it looks fine
 
looks like it works
 
ok you have run it and it seems to be fine
basically never modify the original array
make a copy/deepcopy function or sumn and use that
 
ok
lists are mutable, generators can get exhausted
i dont have the access to my computer rn so ill do it later.......
also we have passed 1000 messages
 
8:47 AM
 
9:03 AM
ill just open issues in flax and pyhof reminding me to fix em
 

« first day (35 days earlier)      last day (686 days later) »