[ / / / / / / / / / / / / / ] [ dir / animu / eris / leftpol / marx / newbrit / s8s / ss / vg ][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.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 67664f208fc4003⋯.png (60.49 KB, 1043x195, 1043:195, ClipboardImage.png) (h) (u)

[–]

 No.1009197>>1009216 >>1009229 [Watch Thread][Show All Posts]

I'm currently writing a lisp-like programming language for manipulating and performing calculations based on JSON. It looks like pic related.

When the interpreter stops running it'll print out the final state of input JSON.

What would you guys want from such a language? What are some typical algorithms you guys use with JSON data?

Pic related is what it currently looks like.

 No.1009216>>1009224

>>1009197 (OP)

Handling graphs (and other data structures that don't map metaphorically or idiomatically with the list structure) without autism


 No.1009222>>1009225 >>1009268 >>1009270

A complete and total refusal to run on any UNIX weenie platform.


Running unix is like believing in g*d: you're
an unintelligent weenie who doesn't know
what you're doing but you still gotta tell all
the smart people how to live their lives via
the one true way. Replace g*d and the church
with AT&T and it makes complete sense.


At least Jesus freax don't blow off Dennie D
Ritchie every time they read their fairy tales.
My students never shut up about Ceesus's
holy book.


 No.1009224

>>1009216

That's way out of scope for me, the idea here is that you'd still be working with regular JSON datastructures.


 No.1009225>>1009527

>>1009222

I believe in God so making it refuse to run on non-Unix systems is clearly the logical conclusion here.


 No.1009229>>1009237

File (hide): a46580cbc62761b⋯.jpg (169.62 KB, 566x768, 283:384, __multi_and_serio_to_heart….jpg) (h) (u)

>>1009197 (OP)

>looks like pic related.

Any docs, beyond there two lines? Because only thing I can say from them is that it's fucking ugly.

>Array(0 1 3)

Jesus fucking christ. You market is as JSON manipulation - USE JSON LITERALS

>get

No need for them. If it starts with '/' - it's a get. Assignment has special syntax.

>/caclulations/allitems/ := concat([0, 1, 3], /a/, /b/)

>/caclulations/ := sum(/c/, /a/, 8)

Or why not json instead of syntax - ugly, but save on parser?

>{':=': ['/caclulations/allitems/', {'concat': [ [0, 1, 3], {'get': ['/a/']}, {'get': ['/b/']} ]}]}

>{':=': ['/caclulations/', {'sum': [ {'get': ['/c/']}, {'get': ['/a/']}, 8 ]}]}


 No.1009232

You know Scheme? Do that.


 No.1009237

>>1009229

>Any docs, beyond there two lines?

I've only been writing this for 4 days, of course there aren't any docs.

>Because only thing I can say from them is that it's fucking ugly.

>Jesus fucking christ. You market is as JSON manipulation - USE JSON LITERALS

It's designed to be pretty easy to reimplement, so that it can be put into things like JSON schemas and interpreted by any point in a given system or be used as part of a script etc.

>No need for them. If it starts with '/' - it's a get. Assignment has special syntax.

Inconsistencies complicate things. I don't like them.

>Or why not json instead of syntax - ugly, but save on parser?

JSON makes absolutely no sense for a programming language.


 No.1009265>>1009279

That's one really ugly language. I'm not even sure what that snippet does.

Also how is this even LISP like?


 No.1009268>>1009527

File (hide): 5cc1f0ae49301a8⋯.jpg (18.24 KB, 353x334, 353:334, 7af.jpg) (h) (u)


 No.1009270>>1009342

>>1009222

> g*d

OK, who left the door to the oven open?


 No.1009279>>1009294

>>1009265

It's basically just spaghetticode that does some random calculations and sticks them in the resulting JSON.

It's Lisp-like in that like Lisp uses s-expressions this language uses indentifier(args...)


 No.1009294>>1009297 >>1009387

>>1009279

>uses indentifier(args...)

If you want it to be a lisp like why not use a syntax like.

myFunction [a, b, c] = { calculations:
{ allitems: join [0, 1, 3] a b
, other: sum [c, a, 8]
}
}
Alternatively you could also declare the function with
myFunction {a, b, c} = ...
for if you wanted the input to be an object instead of array.


 No.1009297>>1009300

>>1009294

<Tor users can't delete posts

Meant this for the first code block.

myFunction [a, b, c] =
{ calculations:
{ allitems: join [0, 1, 3] a b
, other: sum [c, a, 8]
}
}


 No.1009300>>1009301

>>1009297

Actually the argument to join should be an array. So here's v3.

myFunction [a, b, c] =
{ calculations:
{ allitems: join [[0, 1, 3] a b]
, other: sum [c, a, 8]
}
}


 No.1009301

>>1009300

v4 I wish I could delete posts

myFunction [a, b, c] =
{ calculations:
{ allitems: join [[0, 1, 3], a, b]
, other: sum [c, a, 8]
}
}


 No.1009342

>>1009270

You have to open the oven to stuff things inside.


The unix weenie is immunized against all dangers: one
may call him a virgin, neckbeard, freetard, nogames, it
all runs off him like water off a raincoat. But call him a
weenie and you will be astonished at how he recoils,
how injured he is, how he suddenly shrinks back: Ive
been found out.”


 No.1009346

This is a programming language I implemented a while ago. This program gets a list of numbers from standard input, adds them together, and prints them out. It's a bit like brainfuck + Tcl.

<: a
<- "Enter number #" [=> n] ": "
<= [=> n] [->]
<= n [+ [=> n] 1]
>: [? [> [=> n] [=> nn]] c a]

<: c
<= r [=> [=> l]]
<: l
<= l [+ [=> l] 1]
<= r [+ [=> r] [=> [=> l]]]
>: [? [== [=> l] [- [=> n] 1]] f l]

<: f
<- "The result is " [=> r] "\n"

<:


 No.1009387>>1009405

>>1009294

Because quite frankly alot of those characters are just redundant.


 No.1009405>>1009520

>>1009387

Then why did you want to make a LISP that used JSON objects instead of lists?


 No.1009414>>1009522

Why would you use JSON for this?


 No.1009450

File (hide): 65d0fae2b2a7caa⋯.jpg (117.59 KB, 728x1013, 728:1013, d20181127_134533_1307.jpg) (h) (u)

Give it back jml


 No.1009457

if you are good at criticism but end up yourself at LISP you have failed


 No.1009520

>>1009405

So it could be reimplemented easily.


 No.1009522>>1009528

>>1009414

The JSON came first, at work we have a form system based on JSON Schemas which we've modified to implement live calculations, our current solution is basically just running eval() with some custom functions but that's sub-par since the contents of eval() isn't run through babel, it can't be tested very well and as a result people can easily fuck it up.

The idea behind this language is to solve those problems so the next time I want to make something with JSON schema it's not as hacky, gross and prone to breaking.


 No.1009527>>1009799

>>1009225

>>1009268

>no argument

SAGE


 No.1009528>>1009567

>>1009522

<eval

Couldn't figure out how to parse it into an ADT and evaluate it?


 No.1009567

>>1009528

Didn't have time to write a parser. eval() did the job well enough and was considerably better than hardcoding it.


 No.1009799

File (hide): a8d7fdad1b8b16b⋯.jpg (99.63 KB, 1242x1241, 1242:1241, thepain.jpg) (h) (u)

>>1009527

>click to report

>no report button

FFFFFLLLLLOOOOOWWWWWEEEEENNNNNSSSSS




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
28 replies | 4 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / animu / eris / leftpol / marx / newbrit / s8s / ss / vg ][ watchlist ]