question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

operator overloads

See original GitHub issue

`lo

i think you have a foundation to close a gap on three fascinating orthoganol programming enablements that will provide an exponent of programming liberties

  • aggressive operator overloading
  • symbol liberties in unicode
  • (lib based) operator precedence overrides and evaluation triggers to enable parser token and direction geometry triggers to change evaluation flavors to forth, algebraic operators, categorical context propagation , and even 2d languages (not a priority)

essentially, the above looks like to me like the tool for any given programming language to most versatiley transcribe expression pasted in from diverse sources and some glue code to patch up the evaluation semantics to match.

a really long time ago the boost c++ team adopted boost spirit to crib a c++ orienttion of weak features in the area above to build parsers in an EBNF look-alike c++ grammar.

having those three things above would enable a snowballing library transcription process from diverse language sources under one join-point.

what is unclear at this time about aa

image

this is a chart with a hint

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jnorthrupcommented, Jul 21, 2021

in java/c98/c++ terms i look at oper precedence as an enum however numerous.

this was forwarded for which I would say my preferences are away from sexp personally https://www.swi-prolog.org/pldoc/doc_for?object=op/3

kotlin has done a few things right that i haven’t seen done since the usenix es shell.

  • ````token```` escapes the java legal character limitation of kotlins’ origins. i haven’t gotten around to tweaking kotlin to just go full unicode but it would be more cool.

  • kotlin “infix” functions specifier indicates to elide the () around next token parameter which has a generics scope to differentiate overlaps.

  • you can write a kotlin infix function that will reverse the immediate order of function evaluation so that you can express f before g but the generics pile up so fast you really can’t make much headway for currying and concatenative expression syntaxes

  • finally, no language i care about has shown the option to create confix operators like superceding or extending the meaning of [] {} <> etc.

inherently json, sgml i.e. some html and xml, and graph notations could all be copmiled with overloads instead of parsers.

this example was from textbook https://gist.github.com/jnorthrup/60d1465c29c85b183d502d521a7b9022#file-implication-kt-L145 just to see how far the kotlin legal syntax could be pushed.

im aware of auto-grad techniques that would again benefit greatly from overloads to replace parsers and precompilers to arrive at a function abstraction into self normalizable concepts. the entry point of thier usecases is matrix math, in languages that are not transparent as such.

1reaction
cliffclickcommented, Jul 20, 2021

Probably straightforward to extend the parser oper syntax to allow new opers. Would also need a way to specify precedence and uni/bin/trin ops. The actual parsing of such is already implemented (table lookup of precedence ops, binary-vs-pre-vs-post, etc). No promises but should be straightforward enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

operator overloading - cppreference.com
When an operator appears in an expression, and at least one of its operands has a class type or an enumeration type, then...
Read more >
Operator Overloading in C++ - GeeksforGeeks
Operator overloading is a compile-time polymorphism. It is an idea of giving special meaning to an existing operator in C++ without changing ...
Read more >
C++ Overloading (Operator and Function) - Tutorialspoint
Overloaded operators are functions with special names: the keyword "operator" followed by the symbol for the operator being defined. Like any other function,...
Read more >
Operator overloading - Wikipedia
In computer programming, operator overloading, sometimes termed operator ad hoc polymorphism, is a specific case of polymorphism, where different operators ...
Read more >
C++ Operator Overloading (With Examples) - Programiz
To overload an operator, we use a special operator function. We define the function inside the class or structure whose objects/variables we want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found