9:00 PM
so a verb is an infix function, basically an operator. they can have right and left arguments, a single right argument, or no argument. The expression is parsed from left to right, so (if I implement some more ops) `3 + 4 * 6 = 3 + (4 * (6))`

in what way are they different than regular operators?

when without arguments, they can do different stuff. so `+ * -` is a new verb, and can be "called" by `5 (+ * -) 9`. This would be different from `5 + * - 9`, which would be parsed as `5 + (* - 9)` with `* -` as unary operators

all right, that's kinda tricky
I think you need to be pretty precise in what is what, and what is allowed
also, there is no precedence?

nope
left to right

is there only infix and prefix?
or postfix as well?
(e.g. in Python, in `"test"[5]` the `[5]` is a postfix)

9:05 PM
oh, nope. that would be implemented as an operator, like `5 { "test"` or something
only infix and prefix , yeah

`integer = [0-9]+`
`nullary = integer`
are there other verbs that do not take arguments?

I don't believe so, no.

`unary = [-]`
anything else?

I don't think so. Just clarifying: under this, each operator would have a fixed arity, right?

9:09 PM
not necessarily

okay, cool. ideally, most operators would have both unary and binary cases

can you compose verbs of different arities?
wait
`5 + (* - 9)` with * - as unary operators
you said there was nothing else

Well, yeah, it was an example.
I think `-` would suffice for unary for now

@CᴏɴᴏʀO'Bʀɪᴇɴ what is `(- 9)`?
would that be an expression?

yeah?

9:14 PM
is there a convention for what `\$` does in languages?
I mean, in PHP, its used to start variables
but I can't think of any other language that uses it

@CᴏɴᴏʀO'Bʀɪᴇɴ does the thing that you're parsing always have to be a full expression?

@NathanMerrill Perl uses it

for what?

e.g. `+ *` wouldn't be a valid parse?

`\$` is a funny character (that's literally what they call them). It basically specifies the context in which the variable is accessed
`\$` is scalar context

9:15 PM
@NathanMerrill in formal languages it often denotes end of string

(i.e a number or a string, not a list)

@orlp right, like regex

@orlp It would be a valid parse.

but as an operator?

@NathanMerrill It's XOR in Julia.

9:16 PM
@NathanMerrill In J, it gets the "shape" (dimensions) of an object
also it's "reshape"

@CᴏɴᴏʀO'Bʀɪᴇɴ then I'm missing information

@orlp okay, yeah, gimme a sec

ohai

HAI! :D

9:17 PM
sorry for being a bad influence

hmmm, I think I'll make \$ a unary operator then

Supposed to be writing essay about gaileo
@CᴏɴᴏʀO'Bʀɪᴇɴ I completely disagree. <3

@EᴀsᴛᴇʀʟʏIʀᴋ :D

@NathanMerrill What would it do?

9:18 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ moving to skype

nothing

@EᴀsᴛᴇʀʟʏIʀᴋ kk

user definable :)

Oh, OK.
By the way you should have a way for overloading monadic and dyadic versions of an operator. I never understood why C++ didn't let you do that

what do you mean?

9:19 PM
Wow. I get way more work done when I am sick. I just look at all of the tasks thinking "Whyyyy won't you just be resolved already." and I punch them in the face with some code and move on to the next one.

```public someObject operator+(someObject x) { ... }

public someObject operator+(someObject x, someObject y) { ... }```
So you can do something with both `+x` and `x+y` for instance

oh, I have a different solution to that

@quartata you can overload unary plus in c++

well, operators are either unary or binary

@NathanMerrill or nullary, or ternary, or...

9:21 PM
@orlp Uh, you can? Oops.

so `+y` is invalid code if `x+y` is valid

@NathanMerrill What about `-y`?

hmm, good point

You could do `_y` like some languages I suppose, but ehhhhhhh

it makes parsing harder, but `-y` is the negative() operator as opposed to "subtract"

9:22 PM

but operators are always resolved by the variable on the right

@mınxomaτ I'm so confused right now

@mınxomaτ rainbowify it

@orlp fuck I'm stupid
thanks for showing me that

@quartata you can overload the dumbest things in C++

9:24 PM
@NathanMerrill What if you have `string + int`? Wouldn't that mean that it calls `int`'s `operator+()`?

yes
but that said, you can create adapters

@mınxomaτ chiat?

```adapt Int to Addable<String> {
}```

@Optimizer ducat

oh ok

9:25 PM

@orlp oh my

@orlp Do you know anything about Jelly (how it works)?

that's just messed up

@CᴏɴᴏʀO'Bʀɪᴇɴ a tiny bit

J is a tiny bit like that

9:26 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ By the way, Jelly doesn't have monadic/dyadic versions of verbs unlike J

so long and thanks for the fur.

@quartata yeah :|

@CᴏɴᴏʀO'Bʀɪᴇɴ orlp knows APL, explain it to him like that

@quartata ?
no I don't

9:27 PM
darn

hmmm, I don't think I'm going to allow `-a`
its a pretty rare use case

just use `_`
_a

no, that's confusing

@CᴏɴᴏʀO'Bʀɪᴇɴ I just need to know

it looks like another variable name

9:28 PM
what do you call the result of the parse?

@orlp I thought you said you did

@orlp oh. a verb

@NathanMerrill Uhh, no it's not?

ah, so not an expression
allright, just to confirm
`10 20` is not a valid verb

9:29 PM
`* +` is a valid verb

Yes.

@quartata defining negative constants is pretty common, but simply doing something like `a = -b` isn't too common. In that case, you can simply do `a = 0 - b`

`+ 10` is a valid verb

No, it's not
it's an expression, evaluating `+`'s unary form at `10`

@NathanMerrill You will make programmers much happier if you allow `a = -b`.

9:30 PM
`10` is a valid verb

I 10 you

@El'endiaStarman I know, but it makes for confusing situations

@orlp It can be a niladic (no argument verb), or data

if you do `a - b ` what gets called?

Song that you are listening to right now. me:Pillowtalk

9:31 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ so why is that a verb, but `+ 10` is not?

hmmm, I guess that's not too bad

@Optimizer Reckuhless behavyuuuuurrr

@orlp uh. I guess `10` isn't a verb

@NathanMerrill I would think that binary minus has higher precedence than unary minus.

@Rainbolt yeahh
coz of that part only
and Gigi <3

9:32 PM
And/or you only do unary minus when there's no left argument.

@Optimizer "Sweet dreams" by Eurythmics

its actually not ambiguous, because `a c` is invalid

beh duh daze, beh duh daze, bedduhdaze

@El'endiaStarman right

@CᴏɴᴏʀO'Bʀɪᴇɴ so is a verb just a sequence of binary operators?
and nothing else?

9:32 PM
It's a sequence of operators.
(An operator is also a verb)
I'm now realizing how complicated what I want to do is ._.

so far that's really simple

One of my guiding principles in developing Pytek is essentially "If it's harder for the developer but easier for the user, it's worth doing." Of course, as a rule of thumb, there are exceptions, but I think it holds true in general.

I think you're just not describing it fully to me

@NathanMerrill Did a quick `grep -r --include "*.java" -e "-[a-zA-Z]"` on one of my projects and found quite a couple
especially in mathier parts

but there is nothing to parse here, except maybe parenthesis (although I don't know those interact)

9:34 PM
@El'endiaStarman right, but I was trying to avoid the potential confusion to developers around operator overloading

So there are verbs, adverbs, and data. adverbs modify verbs, and they are parsed right-to-left. So say `~` is an adverb. `3 +~ 5` = `3 (+~) 5`

@quartata that could easily include statements like `a-b`

@NathanMerrill Ah-huh, I see.

@NathanMerrill I always have whitespace between my arguments like that

Sorry, there are verbs, adverbs, conjunctions, and data. (and some others)

9:36 PM
```verb = '(' verb ')' / binary verb?
binary = [-+*/]```
that's what I have so far
a verb can be parenthesized

Jella Jella Jella Jella Jealous

@orlp yes

or can be a binary operator, optionally followed by another verb
@CᴏɴᴏʀO'Bʀɪᴇɴ in what way does this not fulfill your problem?
it seems to simplistic to be the solution

I think it does

so which part didn't you tell me yet

9:39 PM
monring

are you sure you don't want to parse expressions?
rather than singular verbs?

alright, what's an expression? Just to be precise

that is my question to you
what are you parsing

Agh why did ruby have to make `true` and `false` two separate classes? ಥ_ಥ

@Optimizer Jelly_ous_

9:40 PM
@orlp I'm trying to make a language

@CᴏɴᴏʀO'Bʀɪᴇɴ unless that language only consists of verbs, I don't think we're done
you only described to me what verbs are

but you also mentioned unary operators and numbers, which do not occur in the definition of a verb

"Verb" is a general class of operators -- unary or binary

9:43 PM
@Optimizer firebug theme*
it seems

not just that
dom panel
also, the major maintainer of firebug: Honza is full time working on Firefox Devtools now
network logs in console too

```verb = modified_verb+
primary_verb = '(' verb ') / binary
binary = [-+*/]

ohai

@CᴏɴᴏʀO'Bʀɪᴇɴ why are you so silent :(

sorry

9:52 PM
rofl

kay sorry what was going on?

`+~` or `(+ *)~`

shit wtf am I doing here

is that correct?

bai!

9:56 PM
@orlp it should work

ok, now that we can parse verbs
what do we do with that?
we still don't have numbers or expressions

alright, so expressions are combinations of numbers and verbs
(number) (verb) (number) (verb) ...

can expressions be parenthesized?

e.g. `(((5)) + 3) * 4`
these are important details :)

9:57 PM
yeah
yeah, sorry XD

ok, another language design question. when would the best name for a variable include a number?
I'm considering disallowing numbers in variable names :)

```expr = primary (verb primary)*
primary = '(' expr ')' / number / unary primary
unary = [-]

verb = modified_verb+
@NathanMerrill `side1`, `side2`, `side3`
Although I suppose you could always do `side_one` `side_two` `side_three`