[ / / / / / / / / / / / / / ] [ dir / asmr / canada / chaos / fur / newbrit / rwby / sonyeon / strek ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

[–]

 No.799636>>799947 >>800052 [Watch Thread][Show All Posts]

K-lang is a JIT compiled, math efficient language.


~ Comments start with a tilde.
~ Variables.
a := 0. ~ Variable names must be 1 character, can be any UTF-8 character except the ones used in the language
~ The assignment operator can be either := or UTF-8 ≔, because I can't type ≔ on my keyboard.
b := 3/4. ~ There are no floating point numbers; only fractions. The language has very fast fraction operations.
c := (1, 2, 3, 4) ~ Simple tuples.
d := (x: x ∈ N). ~ Set-like tuples. Lazy evaluated.
e := (x: x € N). ~ Can also use euro sign.
f := d_1. ~ Accesses the first element of the tuple.
g := [1,2,3;
4,5,6]. ~ Simple matrices.
h := g_1_1 ~ Matrice indexing.

~ Basic mathematical operations.
~ Addition:
4 + 4.
~ Subtraction:
4 - 4.
~ Multiplication:
8 · 4.
8 × 4.
~ Fractions:
3/4.
~ Powers:
2².
2³.
2^n.
~ Roots:
√2. ~ Square root of 2.
3√2. ~ cube root of 3.
n√m. ~ n root of m

~ Logical operators.
1. ~ equivalent of true
0. ~ equivalent of false
1 ∧ 1. ~ returns 1
1 ∧ 0. ~ returns 0
1 ∨ 1. ~ returns 1
1 ∨ 0. ~ returns 1
1 = 1. ~ returns 1
1 /= 1. ~ returns 0
1 ≠ 1. ~ returns 0

~ Conditional
1 ∧ 0 → 1. ~ [CONDITION] → [STATEMENT]

~ Functions.
~ Basic function syntax:
fun(a, b, c, d) := { a · b · c · d. }. ~ The last evaluated value is returned.

~ Fibonacci.
fib(n) := { n ≤ 2 → n.
n > 2 → fib(n - 1) + fib(n - 2). }.

~ Lucas numbers.
lucas(n) := { n = 0 → 2.
n = 1 → 1.
n > 1 → lucas(n - 1) + lucas(n - 2). }.

~ Factorial. Built into the language, i.e. „5!”.
fact(n) := { n ≤ 0 → 1.
n > 0 → n · fact(n - 1). }.

~ Fizzbuzz.
fzbz(n) := { ¬(n mod 3) ∧ n mod 5 → "Fizz".
¬(n mod 5) ∧ n mod 3 → "Buzz".
¬(n mod 15) → "FizzBuzz".
n mod 3 ∨ n mod 5 → n. }.

 No.799638>>800102

At last, a non-meme language for $CURRENT_YEAR.

If you're not doing maths with your computer, you're using it wrong anyway.

Computers are made for calculations and scientific purposes, nothing more. Anything else is degenerate and most probably buttnut.


 No.799645>>799648 >>799649

Oh, another shitty meme from the IRC kiddies.

Does your retarded language do anything more than merely represent real numbers if the only number data format is rational?


 No.799648

>>799645

Why would you need anything else?


 No.799649

>>799645

>full power of mathematical notation

>do anything more than X

LARPer detected, harmless CantDoShit CantPostShit Anonymous.


 No.799661>>799664

>rips off N-lang

>doesn't even post full spec

>tripfag

Daily reminder that [k00l]shamoanjac got hacked through his bash IRC bot.

Daily reminder that [k00l]shamoanjac LARPs as an embedded engineer but admitted he was 20 years old on IRC (public logs available).

Daily reminder that [k00l]zduchac is underage and it shows.

Daily reminder to filter [k00l] names.

Daily reminder to hide [k00l] threads.

Daily reminder to not reply to [k00l] posts.


 No.799663>>799805

File (hide): a0784fd47f3c47c⋯.jpg (22.02 KB, 305x470, 61:94, 1435088853382-2.jpg) (h) (u)

>k-lang

>klang

>kang

KANGZ


 No.799664

>>799661

>posts in the wrong thread

>still mad about me having a real job

>knows IRC logs by heart but doesn't know the KKK00lang idea is 2-3 weeks old

I was gonna politely sage for off-topic but instead I'm gonna upvote bump for maximum butthurt.


 No.799805

File (hide): 5c60ea66084ee3e⋯.gif (1.96 MB, 636x345, 212:115, MUH.gif) (h) (u)


 No.799813>>800046

>There are no floating point numbers; only fractions. The language has very fast fraction operations.

ABC (or maybe some other Python ancestor at the CWI) did this. It turned out to be a bad idea. Size in memory and computation time grow rapidly as you manipulate numbers, too much to justify the gain in accuracy in most cases. You also have to start doing very arbitrary things when you get irrationals, like from your square roots. Use floating point numbers for most things, make fractions available as an alternative type. Or go big and properly store arbitrary (computable) reals, rational or not. There are libraries that manage it.


 No.799908>>800009

Unicode is cancer.


 No.799947

>>799636 (OP)

we wuz k-langz and shiet


 No.800009


 No.800046>>800049

>>799813

>actually writing constructive criticism in a [k00l] thread

why do you enjoy wasting your time?


 No.800049

>>800046

Unlike you, m712, I can actually write an effective JIT compiler, while you jerk off to Django 20-times-slower-than-PHP software.


 No.800052

>>799636 (OP)

I'll just stick to fortran for my heavy mathematical computation.


 No.800071>>800078

It would be useful if my keyboard had keys for conjunction/disjunction etc, and if FORTRAN/Octave didn't exist


 No.800078

>>800071

Fortan,Octave,NumPy,SciPy,Julia

Bullshit characters is part of the reason APL is rarely used anymore.


 No.800102>>802606

>>799638

>Computers are made for calculations and scientific purposes, nothing more. Anything else is degenerate and most probably buttnut.

>Uses a computer to browse 8chan.

>Uses computer to circlejerk on IRC.

k.


 No.802606

>>800102

These are degenerate uses, kiddo.


 No.802607>>802657

File (hide): 138701c1c88a3e4⋯.jpg (343.28 KB, 981x1089, 109:121, Kdlang22_(cropped1).jpg) (h) (u)

Googled this, and the top hit is pic related. A Lesbian Canadian singer that no one listens to. OP did you just invent this for the post? The links below the dyke were for Julia, seems like K-Lang doesn't even exist.


 No.802608>>802609 >>802626

File (hide): 5106ac4d6389386⋯.jpg (194.38 KB, 590x421, 590:421, Wolfram.jpg) (h) (u)

> He thinks he can write a math language.

Daily reminder that you don't own nothing goyim!

Mathematica is a godsend, so good that even as a committed NatSoc I'd hide Stephen in my attic.


 No.802609>>802614

>>802608

>he does not know about FriCAS


 No.802614>>802634

>>802609

Hardly a Mathematica clone. Don't bother suggesting Sage either, that's garbage.


 No.802626>>802633

>>802608

Mathematica is crap. Aside from muh single license per device rubbish it is also sluggish, bloated has shit syntax and causes cancer if one is exposed to it for prolonged periods of time. Not to mention their fucking download servers are so slow when you need to download 4.5GB of botnet software. It also crashed on me when doing elementary tasks such as finding derivatives (in the middle of lab assignment, so I had to rewrite everything - no recovery feature). For analytical computation maxima works great, for numerical there is octave, for plotting gnuplot, for everything else fortran or c. There is no reason to use this botnet.


 No.802633>>802636

>>802626

It's functional programming style, hardly shit syntax.

For X I can use a, for Y I can use b, .... you're missing the fact that one of mathematica's strengths is that it's all blended into one system with well documented components which interface well to each other.


 No.802634>>802635

>>802614

FriCAS is not clone of Mathematica, it is free software and competing computer algebra system.


 No.802635>>802640

>>802634

>FriCAS is not clone of Mathematica

That's what he said.


 No.802636>>802642

>>802633

>blended into one system with well documented components which interface well to each other.

I don't need "nice" monolithic system, I use UNIX-like system which means programs follow following rules:

Write programs that do one thing and do it well.

Write programs to work together.

Write programs to handle text streams, because that is a universal interface.

So basically I have same capabilities as Mathematica with additional ability to swap components for alternatives and access to lots of other powerful tools.

Only reason why I have Mathematica is that uni forces us to use it. You can't pass class if you don't have required lab work.


 No.802640

>>802635

Sorry, I am not native English speaker.

To me it seemed like he assumed that it is drop in replacement for Mathematica, like Octave is for MATLAB.


 No.802642>>802650

>>802636

A reasonable answer, I guess I prefer the monolithic approach as it provides some organization over these overlapping domains.


 No.802650>>802654

>>802642

It mostly comes down to what you prefer. I see why they teach Mathematica at uni, though. Most of the students aren't interested in learning about different tools and just want to get things done (or aren't interested in anything at all). If works for you then there is no need to change (unless your license expires :-)).


 No.802654>>802656

>>802650

Part of the problem with different tools interfacing with text streams is that mathematics is full of inherent ambiguities in syntax. Even definitions within the same field can vary from author to author, let alone the lax syntax physicists use! For example, I'm looking at two Mathematical Analysis texts, and they can't even agree on what a Limit Point defines. Ideally, we need an open standard on mathematical syntax and terminology. More fancifully, I wish we had a standard body of mathematical proofs and I want a pony.


 No.802656>>802664

>>802654

An open standard exchange format for mathematics is absolutely possible, which does not necessarily mean that it will ever happen.

But the Unix Philosophy™ claims that the best way to exchange things is plain text, which is not going to work for this. Ignore the unix philosophy. It's mediocre at best and harmful here.


 No.802657

>>802607

Same here, I can't find anything on this. Why make a shitty thread for a language that doesn't exist and then shill it in the first post? Fucking tripfags.


 No.802664>>802668 >>802669

>>802656

> plain text, which is not going to work for this

So passing binary blobs around is better? I don't know what kind of advanced symbol wrangling do mathematicians do on computers but for engineering passing data around as numbers in plain text works well. There is always TeX which is plain text and people use it to write papers. So maybe if you need to pass symbols around you could do it with TeX? There is also eqn and XML based bloat such as MathML. I would like to see some examples of what data you would pass between programs? Proofs? Definitions?


 No.802668

>>802664

It doesn't have to be binary blobs. JSON and XML are neither plain text nor binary blobs. I don't think TeX is usually considered plain text either. But you need more structure than you get with the unix way of doing things. Unix tools are designed so they can all talk to each other, but when you're passing mathematical data around it's so specific that both the input and the output should talk the same (at least somewhat) specialized language.

I don't have experience with MathML, but I think TeX and MathML are both unsuitable because they focus on presentation, not meaning.

And yeah, passing definitions or just mathematical objects in general around is what I think you'd want. I have very little experience, but I don't think TeX would be a good way to let Sympy talk to Mathematica.


 No.802669

>>802664

We were thinking of using a special editor for K-lang, that perhaps used some format of LaTeX for storage.

For example, if you write \mat(2,3) the editor will make you a 2x3 matrix with editable fields. Very handy if you ask me.




[Return][Go to top][Catalog][Screencap][Nerve Center][Update] ( Scroll to new posts) ( Auto) 5
37 replies | 4 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / asmr / canada / chaos / fur / newbrit / rwby / sonyeon / strek ][ watchlist ]