[ / / / / / / / / / / / / / ] [ dir / agatha / arepa / builders / cutebois / fascist / imouto / marx / 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

New Volunteer

[–]

 No.939375>>939441 [Watch Thread][Show All Posts]

I think homoiconicity is a very underrated property of programming languages. Not many languages are homoiconic and even less are well known (LISP being the most well known.

I kind of wanted to make a small toy homoiconic scripting language that is easy enough for humans to read/write (was thinking of a Pascal or Python-like syntax). Unfortunately, most homoiconic syntaxes are symbol salads or expect things to be written in RPN which imho is a nice thing, but that would probably intimidate my average target user. I know it probably is almost inevitable conaidering the nature of these languages, so I was thinking of implementing it as a stack based virtual machine with some rich assembly-like mechanics, or simply implement a thousand syntax sugarcoating features if I didn't find a better syntax.

Does somebody know of any homoiconic programming languages with nice and clean syntax I can draw inspiration from? Also, homoiconic programming languages general, I guess. Pic unrelated, I just like Madoka

 No.939382>>939396 >>939402

If you think that forbidding compiler from making optimizations is a good idea you should apply yourself.


 No.939392

But can you make a simple text editor with it?


 No.939396

>>939382

enjoy your riced out buggy compiler faggot


 No.939402>>939407

>>939382

>Implying you can't JIT it

Lmao


 No.939407>>939410

>>939402

JIT compilation got to be one of the most retarded technologies out there.

>hmm should I compile the whole thing?

>it will take up less space and will run hundreds of times faster

>nah this 200 000 cumulative LOC function is only called a couple of times, compiling it would take whole 0.025 seconds, just let it rip for 40 minutes straight


 No.939410>>939412 >>939592

>>939407

There is absolutely no way of compiling dynamically arbitrarily generated code at runtime without JIT. It is physically impossible, and it would be akin of asking the compiler to compile your program before you ever write it.

JIT is, in my opinion, not the smartest of the ideas tech had, but it has its advantages, like being able to profile code at runtime to optimize accordingly, something an AOT compiler can't do (so AOT compilers sometimes take wild guesses at what will be more optimal at runtime). You could even do a two pass approach like Java does, and compile a bit AOT, then optimize runtime-bound stuff with JIT.


 No.939412>>939509

>>939410

>that JIT meme

PGO exists, you know.


 No.939415>>939462

So what's your fundamental structure going to be?


 No.939437>>939494 >>939497

Homoicon is a meme.

Trust me, I've written an implementation of the syntax case expander; meta programming is way more involved than having a parser in your run time.


 No.939441

>>939375 (OP)

>I think homo is a very underrated property

OP is a faggot once again


 No.939462

>>939415

Probably a lists tree, unless you have a better suggestion, which was kind of what I was hoping to get opening this thread.


 No.939494>>939497 >>939527


 No.939497>>939500

>>939494

hes right >>939437 proper homoiconic macro expansion systems are complicated as fuck. there are only a few probably incorrect implementations in the world.


 No.939500

>>939497

*hygienic homoiconic


 No.939509>>939532

>>939412

PGO is a meme. Look at the performance issues with Denuvo as an example of how unrealistic accurately profiling something more complex than a benchmark is. If you're not aware, the process of adding Denuvo to a game takes profiling data provided by the devs to avoid fucking up a hot path, but real code is so conditional that it winds up often severely impacting performance. And that's with a very large amount of effort being spent to get that profiling data.

Hotspot-style JIT has the promise of solving this once and for all but hasn't worked out due to the obscene amount of bloat it requires to operate.


 No.939527

>>939494

I'm not gonna pretend I fully grok that shit, but Matthew Flatt has published a series of macro expanders for racket ranging in complexity.

Search for pico|nano|demi racket expander, his approach (scope sets) is way more understandable than Kent Dybvig's "beautiful code" syntax case (mark and substitution model).

I'm not trying to dismiss quotation and serialized representations of internal data structures, but homo icon worship is a relic of ugly ass old school lisp macro systems.


 No.939532

>>939509

I've used PGO with success to gain a massive amount of performances. And this was without gcc-8 which brings a lot of improvements to it (https://gcc.gnu.org/gcc-8/changes.html).

See https://bugs.gentoo.org/615412#c12

See clear linux using AutoFDO (which is PGO using perf instead of gcc's profiling) and powning other distros in benchmarks.

See serious software like gmp using PGO themselves.

>Look at the performance issues with Denuvo as an example of how unrealistic accurately profiling something more complex than a benchmark is

Please provide a link, I didn't find anything about it.


 No.939592

>>939410

Nigger there is no reason whatsoever to have only some of the code be executable machine code and have the rest be interpreted byte code.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
18 replies | 1 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / agatha / arepa / builders / cutebois / fascist / imouto / marx / vg ][ watchlist ]