« first day (1461 days earlier)      last day (1199 days later) » 

8:01 PM
i also considered compiling APL to C++ or Rust
 
@KamilaSzewczyk Aren't some implementations of it somewhat faster than those two when it comes to array-related stuff?
 
the first one was mildly disappointing - i tried to make an APL-style sum+iota function, and std::iota/std::reduce was horrible, the optimized formula method was the best (x(x+1)/2), and the streams-v3 and boost hana method was decent-ish
meanwhile when i threw it into the rust compiler, i got really high quality output
@user i was thinking of making something which isn't as flexible as APL, but thanks to that can be optimized better
like, supporting, say, rank 5 arrays at most
 
Oh, I see.
 
or ditching eval
 
ngn
or making the language statically parsable
 
8:04 PM
yes, that too
i wanted to somehow provide type definitions and compiler hints for functions
but i didn't come up with a good syntax yet which would fit APL's terse syntax
 
ngn
@KamilaSzewczyk 4 more ranks till k :)
 
I wonder what a statically typed version of APL would look like.
 
at first i thought about a somewhat bad idea of utilizing the fact that assignment only produces constants, to modify it to convey type information if it can't be trivially deduced
we already know what is the signature of f, so x←f 2 doesn't need a type signature
 
ngn
type inferrence? there have been attempts..
 
but if i did something like g←{...}, then i'd maybe require providing a prototype
 
8:06 PM
@KamilaSzewczyk 'assignment only produces constants' what?!
 
@rak1507 that's right, no mutable state, we're making APL purely functional.
 
ok, cool, but how do you name a function
 
like I just showed
you can't reassign functions
 
ngn
@KamilaSzewczyk oh, so proper dicts too
 
i plan on bringing lisp-isms in, data structures, probably some more stuff
 
8:08 PM
oh, I read constants as in 'things that aren't functions'
 
@rak1507 think of it as of a function pointer
i'm afraid i'll end up making haskell but somewhat worse in the end
 
I just got confused and associated 'constants' with like, mathematical constants or something
 
So how would you give it type hints?
 
@KamilaSzewczyk monads in APL when
 
@user and this i haven't worked out yet
 
8:09 PM
And generics would also be a bit troublesome.
 
my initial horrible idea was making generics/guards just like they are in C++, but this is a fuzzy and potentially bad idea
 
@KamilaSzewczyk but with more symbols!
 
as for the type hints, I was thinking of something like g::u->u g←{...}
 
Monomorphization? That wouldn't be too bad.
 
assuming u is some integer type, just like they are in K
or you could have type definitions near function bodies but this seems a bit readablen't to me
 
8:11 PM
@KamilaSzewczyk but using actual arrows because why not
 
yes :p
 
@KamilaSzewczyk "readablen't"?
 
@user i like playing around with english vocabulary and grammar
 
@KamilaSzewczyk Er, ok.
 
sorry if that's annoying, i found it a bit silly and creative, maybe a bit fun
 
8:12 PM
me too
 
It'd be fun to see implicit parameters in APL too, or at least typeclasses
@KamilaSzewczyk Not annoying, just confusing
@user Though that would probably ruin the syntax.
 
ngn
new implementers always dream big (static typing and stuff), but it's hard enough to make even a boring interpreter
 
@ngn i'm actually simplifying APL by quite a lot here
 
@ngn Shoot for the stars, and you may reach the moon.
 
so much that i'm afraid that it'll lose most of it's terseness properties :p
 
8:17 PM
@KamilaSzewczyk I mean, if you're going to make it like Haskell, it'll still be pretty terse, just not APL terse.
 
@ngn but people who have already written interpreters will probably just stick to theirs, so with that mindset you're never gonna advance
 
terseness is cool, but usefulness is better :p
i mean, limited ranks, no eval, statically compiled, static type hints so the grammar isn't ambiguous and you can actually parse it, no tacit programming
it's pretty evident that i'm trying to make something simpler and less flexible here :p
 
Terseness is useful. The less space your code takes up, the more space there is to do calculations, so you get faster code :P
 
ngn
@KamilaSzewczyk multidimensional arrays?
 
this logic makes sense mostly for CPUs, not in terms of more space to do calculations
 
8:20 PM
@KamilaSzewczyk properly using/validating type hints is hard though. The type of even + is pretty complicated
 
@dzaima That could be handled by not allowing schizophrenia, like Jelly does.
 
@dzaima type of + depends on it's operands
you already know types of the operands
so you know the result type /shrug
 
ngn
@KamilaSzewczyk what is type? e.g. is it "int" or int64,int32,etc?
 
Here's a question about a type system for the J language.
 
@KamilaSzewczyk so if you have a generic function, you won't be able to type-check it without concrete arguments?
 
8:23 PM
1) types are the same => result is obvious
2) types aren't the same => it picks the bigger type and the result is of this type. the smaller argument is being promoted
@dzaima the user provides the signature of the function, and i have signatures of all existing functions/entities, why can't i type check it?
 
ngn
because of overflows?
 
@KamilaSzewczyk is g::(u[],u[])->u[] g←{⍺+⍵} valid? Or do i need to somehow specify that both and have the same length?
 
i won't handle overflows, at least yet
@dzaima i think i may let it bail out in the runtime
and check for obvious cases when it's called with arrays of different length
 
Might be better to keep it mostly dynamic and do some dirty casts to make the C compiler accept it.
 
i want to make parsing decidable
oh also
hmm
 
8:29 PM
Couldn't it still be decidable if you don't have mutable state and there's no eval?
 
also types themselves are complicated. you want to have types for: 1) any length vector; 2) any rank array; 3) 2-item vector of a character vector and an integer vector; maybe also 4) matrix with 2 rows and any number of columns
 
ngn
@user not without changing apl's syntax significantly
 
@ngn how so?
 
Actually, you could still keep mutable state, just not allow assignment of a monadic function to a variable that previously held a dyadic function and stuff like that.
 
8:31 PM
i don't want mutable state because it will interfere with optimizations
the only thing i can think of is the dfn/dop type problem
 
@ngn Why would you have to change APL's syntax?
 
but maybe i could have different constructs to mark a dfn and a dop?
 
@KamilaSzewczyk Don't allow schizophrenia.
 
what in the world is schizophrenia
 
ngn
@KamilaSzewczyk the classic example is: a b c. how do you parse that? a(b c) or (a b)c
 
8:32 PM
@ngn give types of a, b and c
dfn/dop/value are valid answers
 
ngn
oh, ok
 
this was exactly the reason why i wanted type hints
 
@KamilaSzewczyk It's more fun to say than function-operator overloading. Apparently, back in the day, they thought MPD/DID and schizophrenia were related.
 
to avoid this horrible thing
 
Couldn't you tell the types of a, b, and c by looking at whether or not they contain ⍺⍺ if they're in braces?
 
ngn
8:35 PM
@user a, b and c are just identifiers. you need to know what's behind them at runtime.
 
but... you know what's behind them
you're compiling APL
/interpreting
 
ngn
but yeah, with a bit of static type inference you can make it work for most cases
 
doesn't matter for this case
 
@ngn But if these variables were already defined before, you'll know their types already.
 
ngn
would ⍺⍺ and ⍵⍵ have to always be functions?
 
8:37 PM
can they be something else?
 
Unless you typed a b c befor eyou typed a←..., etc.
 
ngn
@user right
 
Haskell handles this problem quite well.
 
@user my idea was to defer parsing {}'s and overall definitions before building the "symbol table"
 
@KamilaSzewczyk 1(2{⍺ ⍺⍺ ⍵⍵ ⍵}3)4 is a 4-element vector
 
ngn
8:37 PM
in ngn/apl i did this inference scope by scope. i wouldn't recurse into an inner pair of { } before i've processed the outer one
 
yeah, i had the same idea
 
@user Even for Dyalog's dfns it can mostly be done. See kk
 
ngn
this helps compile things like mutual recursion: {f←{g ...}⋄g←{f ..}}
 
yep, that's what i thought of
so far even thinking of implementing an APL dialect is exhausting
 
Btw, I think the strict naming convention, as used in BQN, is the best way to make it possible to statically parse APL.
It helps the human reader too.
 
8:40 PM
like?
 
What's the strict naming convention?
 
is it what i'm thinking of? (semantic names)
 
Lowercase for functions/uppercase for operators?
 
ngn
or underscores
 
8:41 PM
It doesn't really matter what the exact scheme is, as long as you can distinguish arrays, function, monadic operators, and dyadic operators.
 
Are you going to use dfn/dop syntax or tradfns (or both)?
 
I find that array, Function, _MonOp, _DyaOp_ works well.
 
ngn
@KamilaSzewczyk it will only take a few years :)
 
depressing.
 
Though making arrays uppercase and all other lowercase would work well too.
 
8:43 PM
a few days ago i hacked together a bit of code which supported strands, scalars, +-×÷ and monadic dfn's
and assignment, of course
 
ngn
@KamilaSzewczyk that took me about a week or two, and the whole interpreter ~3years, so you can probably do the whole interpreter in a year :)
 
oh well, i didn't really care about the style and i wrote it in JS, and i used a PEG
i got crazy with the operators by giving them around 6 or 7 meanings because h.
 
CMP: What are the minimum features for an APL dialect to be considered an "APL dialect"?
 
ngn
@Wezl depends on who you ask
 
well I'm asking everyone
I need opinions
 
8:46 PM
another chat mini something: how much of an overstretch would be calling my APL dialect "APL"
 
Well, every APL dialect I know of has +/ mean "sum"…
 
ngn
@KamilaSzewczyk 7.34
 
there was a standard at one point
 
thanks for a very precise answer
 
ngn
:D
 
8:47 PM
@Wezl for me - 1) you can do scalar + array which vectorizes; 2) there's a reduce operator
 
what is the scale?
 
@KamilaSzewczyk I think that'd only make sense if most basic APL\360 statements work with no modification.
 
do we assume ⎕io←0 or ⎕io←1 or ⎕io←0.5?
 
0 to many
 
ngn
@KamilaSzewczyk millistretches
 
8:48 PM
@Adám but what's "basic"?
 
damn, that's really low
 
@Wezl Yeah.
 
I'm so disappointed that there's no xterm escape sequence to insert a new line of text without disturbing the line the cursor is on.. that sounds like such a basic scenario
(For any application that wants to output lines while keeping a simple input prompt at the bottom)
 
ngn
@goof rlwrap not good enough?
@KamilaSzewczyk one language used centistretches instead and it tore off apl, flying in the direction of lisp :)
 
@ngn It's a cool hack / useful tool but I'm disappointed that there's no "three lines of C max" solution for this :P
 
ngn
8:58 PM
sorry, on behalf of c :)
 
Like all of unix, you can easily get 95% of the functionality you need, and then you need 20000 lines of libraries and crap for the next 1% :P
Even if that 1% is just a small tweak to what exists there already
Does not compose well, does not extend well..
 
@Wezl infix notation maybe
 
9:12 PM
@cannadayr even for user functions?
 
@dzaima I think we ultimately want something higher-level to work with (hopefully most of the implementation would take place in the new language though). Here's another sketch:
I'd like it to be mostly APL- or K-like other than the types and control structures.
The {} parameters are always computed and expanded at compile time, and it should be possible to pass anything that's known at compile time in that way. So you can do all sorts of functional programming and type computations at compile time, but not at runtime.
 
ngn
@Marshall what should be the result from compiling that - c code? an .o file? a buffer filled with x86_64 code?
 
@ngn I think we'd want multiple backends. Probably C with vector intrinsics is easiest to start with, since we don't have to do register allocation.
 
@Marshall i also decided to switch to pointers & size for the basic functions. everyone could easily argue forever about what specific syntax should things have, so i'll decide to not
 
ngn
@Marshall that's a very ambitious goal
 
9:23 PM
@ngn starting out, a single backend isn't that ambitions, and it definitely isn't unreachable
 
ngn
maybe LLVM IR or something for multiple targets?
 
@ngn that'd be an "easy" next step after C generation
 
@ngn We definitely want some sort of IR. I don't know how LLVM does vector instructions so I don't know if it's suitable.
 
ngn
idk either :(
 
@Marshall my educated guess is that it does exactly what you see in clang - there are types for vector registers of certain sizes, and builtins that act on them
 
9:26 PM
@dzaima That works as long as it supports all of x86.
 
@Marshall I think they have a bunch (or maybe you have to write your own wrappers). I think that's what ISPC does
 
@Marshall i think it might be better to have a custom internal IR. could take ideas (heavily) from LLVM or whatever, but LLVM IR itself will probably be too cumbersome
 
Although the thing about our version is that the source code should describe exactly the instructions in the object code, so we don't want LLVM to do any sort of optimization.
@dzaima If we can use a subset of LLVM then that would be nice.
All we really want is x86 but stack-based and with structured loops.
 
ngn
this is the IR my addII() function compiles to:
define internal i32 @addII(i32* noalias %0, i32* noalias %1, i32* noalias %2, i64 %3) #6 {
  %5 = ptrtoint i32* %0 to i64
  %6 = and i64 %5, 31
  %7 = icmp eq i64 %6, 0
  tail call void @llvm.assume(i1 %7)
  %8 = ptrtoint i32* %1 to i64
  %9 = and i64 %8, 31
  %10 = icmp eq i64 %9, 0
  tail call void @llvm.assume(i1 %10)
  %11 = ptrtoint i32* %2 to i64
  %12 = and i64 %11, 31
  %13 = icmp eq i64 %12, 0
  tail call void @llvm.assume(i1 %13)
  %14 = add i64 %3, 7
  %15 = and i64 %14, 4611686018427387896
 
@Marshall i don't think LLVM is stack-based, nor does it have structured loops?
 
9:30 PM
@Adám do you have an example? (not sure what you mean)
@Marshall what are yall working on?
 
21 hours ago, by Marshall
If anyone wants to get together on a b-ish (Whitney's b) vector language I'd definitely contribute.
 
ty.
 
@cannadayr The idea is that this would just be for implementing SIMD kernels for array languages. C-like languages make this difficult, especially if you want to write code that handles multiple types.
 
@Marshall yea the closest i can think of is something like SAC
 
@dzaima The SSA thing is probably easier than stack-based actually.
 
ngn
9:35 PM
does it deserve an own chat room? i guess most people here wouldn't be too interested in such low-level stuff
 
yes, stack based vector language! raw.githubusercontent.com/ktye/i/master/_/ps/k.ps
 
i hope this doesn't mean i have to move on from BQN after i finally might get the VM working ;)
 
@cannadayr BQN will still exist. what'll be happening is there will be a better language in which to implement BQN (or its builtins) in
 
@cannadayr If erlang has SIMD bindings then you could make an erlang backend for it and have an actually fast BQN.
 
@Marshall ill do some benchmarking, but my idea is that ebqn will be a control-plane language only -> small datasets, mostly to communicate state changes between nodes
 
9:38 PM
This definitely doesn't compete with BQN. It's a DSL, really.
 
what i would want after that (who knows, im not made of time), is a data plane language, which is what this sounds like
 
@ngn Yes, and we probably want some system where we can start making design docs instead of sticking everything in chat.
 
ngn
@Marshall a wiki?
 
@ngn Sure.
 
@cannadayr k does not allow things like f←{2×⍺+1+⍵} ⋄ 2 f 3
 
9:43 PM
We could open a TopAnswers room as well if we want to keep talking.
 
@Adám fair enough. i guess we need 3 categories. APL languages. non-apl languages. and languages that are neither APL or not-apl
 
ngn
@Marshall as long as it's publicly viewable and backupable, i don't mind
 
i would be interested in following but not sure ill be able to contribute much
 
@Marshall having *: just be implemented for you is cheating a bit. imo there should be primitive builtins for operations currently available in at least one targeted architecture, everything else needs to be manually implemented (as that's what you'd need to do anyways)
 
@dzaima It would be implemented within the language. I think there's going to be one best way to multiply with overflow, so you shouldn't have to reimplement it for every program you write.
 
9:46 PM
@Marshall hm, i guess it could be in the stdlib of sorts
oh, you'd want a stdlib anyways, for implementing things not available in only some architectures
 
Here's our room: topanswers.xyz/apl?q=1623
2
 
10:06 PM
@Adám only got notif now. Any time should work for me, I don’t have many meetings. I’m in Berlin time zone
 
@pitr Let's do Wednesday at 16:00 UTC/17:00 CET.
@cannadayr Did you want to participate too?
 
@Adám maybe! ill mostly stay on sidelines to not try and derail the convo
 
@Marshall I like etherpad (especially bc I can't use topanswers)
 
10:21 PM
@Wezl Why not?
 
@Marshall terms and conditions
 
 
I never said I was going to break the CoC
 
@Wezl I can't find any terms or conditions for using TopAnswers. What do you mean?
 
last I checked you had to be 16+ to join
 
10:36 PM
@Wezl can't find anything anywhere saying that. maybe you're thinking of Codidact?
 
@Adám sounds good. Meet here?
 
@Wezl I don't see where you'd be presented with T&C either, as you just join by clicking a button and then optionally set profile information.
 
...last I checked
 
Announcement: Live coding session, prototyping load-on-demand in APL; Wednesday 16:00 UTC at twitch.tv/adambrudz
@pitr @rak1507 @KamilaSzewczyk @RGS @cannadayr ^
 
@Wezl something like that would be nice, but it doesn't seem very suited for code
 
10:42 PM
It's almost ok if you set the font to monospace, (gear menu)
 
10:55 PM
@Marshall error: "ERROR: invalid question CONTEXT: PL/pgSQL function raise_error(integer,text) line 1 at RAISE SQL function "login_question" statement 2 SQL function "login_question" statement 1"
 
@chrispsn Try again?
 
Now working - ty
 
@Adám told me to flag the question to call a mod to change the question type, but it seems flagging also makes it disappear?
 
@Marshall Oh, maybe I remember wrong (I'm fairly new to TA too), try removing your post flag and flagging your comment instead.
 
@Wezl ...or lie
 
11:06 PM
@rak1507 well yes, but I don't think I can sign up because I have to access it through a proxy anyway
 
oh do you have some sort of internet controls that block .xyz? it's blocked for me at school
(unlike the APL orchard, which is probably bad for my education but oh well ;) )
 
I don't think it specifically blocks .xyz, but it block lots like the pictures I proxy through Google Docs or the ->irc->matrix->element bridges, and even the main etherpad website (I use an alternative instance) (and twitch.tv btw)
open source and self hosting have been good to me though
 
Ouch, that's a lot
 
RGS
11:33 PM
@Adám Thanks for this. Is there an expected duration for the stream?
 

« first day (1461 days earlier)      last day (1199 days later) »