His programming language cannot generate code

>His programming language cannot generate code

Attached: lisp.png (256x150, 20K)

Other urls found in this thread:

nyx.net/~gthompso/quine.htm
esolangs.org/wiki/List_of_quines
archive.fo/mnbNo
archive.is/oUEwA
github.com/froggey/Mezzano
common-lisp.net/project/able/
youtube.com/watch?v=t09AJUK6IiM
groups.google.com/d/msg/racket-users/MKJ4Kdy30YY/elZwCG6BAQAJ
docs.racket-lang.org/sweet/index.html
github.com/froggey/med
twitter.com/NSFWRedditVideo

Shut the fuck up

brainlet here, what does it means to generate code? write programm without programmer?

(defmacro get-out (&rest shitposters)
`(progn
,@(loop for fag in shitposters
collect `(shitposter-cry ,fag))))

Can't think of one right now, excluding of course those really autistic "languages" that are created only to be funny and half the time aren't even Turing complete. All the usual stuff qualifies: nyx.net/~gthompso/quine.htm
And even a lot of the autistic stuff does: esolangs.org/wiki/List_of_quines
And since you aren't talking about quines but just about generating code, any language that may not even be turing complete but has the capability to print arbitrary output could easily just print out a string of valid C or something.

You can write programs that generate programs.
This should also be something that is practical and not just possible. I.e your programs can be represented in a simple format such as a list which can be easily manipulated by another program

In Lisp code is data (from the name List Processor), which means that you can use macro to generate lists and evaluate them at run time. This means that you could write a program that generates for instance (+ 1 1) which sums two numbers. This is a stupid example but metaprogramming can be used to do much more complex stuff in a very concise way.

In C, while you could write code to a file and compile it, you wouldn't be able to do that dynamically without exploiting the memory area of the program. In lisp it is so simple that you can do that from list, at read time, at load time, at compile time, or even at runtime.

Cool, explain why that wouldn't count as "generating code"

You can compile a shared object and then dynamically link it. I've seen this trick exploited for a C REPL, but it's more novel than practical.

you just dynamically create a list that can be evaluated. Thats it.

It still counts, it's just not elegant or convenient. Lisp metaprogramming is straightforward because a Lisp AST is very simple.

Potentially, you could even expand a macro and write the result to a file. I used this to make javascript programs using parenscript's macros.

Nice trips

DESU lisp feels like somebody got bored of implementing an actual programming language and stuck using the thing halfway, resulting in programming the AST directly which surprisingly gave rise to powerful things. This is not a slight against lisp it is rather how it is with all it s-expresions.

CL-USER> (let ((hello '(print "hello world")))
(print hello)
(eval hello))

(PRINT "hello world")
"hello world"
>> "hello world"

Do this in C.

LET makes HELLO a local linked list containing PRINT, "hello world" and NIL.
Printing HELLO prints the whole list to stdout.
Evaluating HELLO runs the list as if it was lisp code. When run, the code prints "hello world" and returns a string, which is why you see it repeated.

In my county we joke about LISP being an acronym for "Language Inutilement Surparenthesé" which translates to "Needlessly Overparenthesized Language"

i wish i wasn't retarded so i could learn lisp and lisp dialects

Attached: frustrated white man.jpg (405x344, 31K)

Literally just call tcc -run lmao

Just learn Scheme my dude.

B-but eval is evil!

>his programming language cannot make a basic text editor
archive.fo/mnbNo
archive.is/oUEwA

Attached: 1523869203258.png (659x720, 287K)

Much of those feelings of inferiority stem from how people hail lisp as the be all end all of programming language design, discard what people say and any preconception about your own intelligence. If you feel like learning lisp I suggest you read `The little schemer', this book should be the lightest and easiest read out there, If you decide that lisp is for you, You might go any direction from there, either Paul Graham's books or Peter Norvig's. If I were you I'd pick SICP and read it from cover to cover while I am at it. A good dose of good engineering never hurt anybody.

perl- can generate code

But that's the thing. In a lisp, the compiler, evaluator and reader are always available even when compiling, evaluating, reading or at runtime.
If you want a repl to a running lisp program, all you do is run
(loop (print (eval (read))))

Literally read-eval-print loop.
Which is also why you don't see that much end-user lisp software. Commercial lisp providers often insist on per-user licensing, because all of the users get to use the same lisp you sold to the developers.

In network code only, or elsewhere where user input being evaluated can cause damage to others.

You're still here?
github.com/froggey/Mezzano
Here's your OS written entirely in common lisp (and some asm). There should be an editor there.

common-lisp.net/project/able/

Attached: funky_kong_06.png (863x1354, 969K)

>But that's the thing. In a lisp, the compiler, evaluator and reader are always available even when compiling, evaluating, reading or at runtime.
That's a good thing and a bad thing. Packaging read and eval with every program bloats the runtime considerably. C deliberately has a very lean mandatory runtime.

Any language with eval can generate code, even if it's not very good at it.

>Packaging read and eval with every program bloats the runtime considerably. C deliberately has a very lean mandatory runtime.

C is also braindead.

C serves its niche properly. C is not for general purpose application development, it's for systems programming and other domains where minimal runtime support is advantageous.

OCaml can do that. In fact, FFTW is written in OCaml.
10/10 would choose lisp over ocaml tho.

Generating code is easy.
Manipulating existing code is where it gets interesting.

Of course it has a niche, a very different niche from that of Lisp, that's why comparing it to Lisp make no sense.

>the absolute state of c++ metaprogramming.

Attached: boost_preprocessor.png (782x631, 37K)

The comparison wasn't raised by me, it was raised by this user .
Clearly, you don't want to be doing this kind of thing in C even if it's possible. The AST is more complicated and the language has nothing built in that lets you manipulate it.

Boost is an abomination. But hey at least we won't have to sfinae soon.

About eval, though.
It's something that should be provided by the operating system rather than every application providing their own.
You can use shared libraries and such with C on Unix, but Unix doens't provide the same sort of flexibility for lisp applications. Often you need to load and compile your code into a lisp, freeze it, and distribute the frozen lisp image as an executable.
Unix provides a filesystem, sockets, threading, and such things. It doesn't provide a garbage collector, a system listener, a GUI, or a lisp evaluator like a lisp operating system would. And so you have to include what might amout to half an operating system with your application when you want to run it on Unix.

Do Lisp OSs like that still exist?
The closest extant thing I can think of to what you're describing is TempleOS with its global symbol table and C JIT.

I linked Mezzano above here , but I haven't looked into it much. I'm not even sure if there is a text editor, or if you're supposed to poke at files on a remote filesystem with telnet and a Unix text editor.
It's a shame that that's mostly it. OS research is pretty much over.

>OS research is pretty much over.
What is left to research?

Racket sure can. And a good thing too since common lisp is C-tier of awkward to use for anything remotely high-level. Its support for higher-order functions is such garbage that even C++ does it better, to the point CL users avoid that crap like the plague.
When racket-on-scheme happens, CL will die.

What is racket-on-scheme?

I hope so, but Common Lisp has still the best macro support. Also, I prefer the CL macros

Fuck, I mean racket-on-chez. They're porting the racket engine (plt) to chez scheme, which would enable much more efficient parallelism and native code compilation, plus generally much higher speed and potentially better gc properties.

>plus generally much higher speed
That is not a goal of the port. It is currently slower than racket and will likely not improve. The whole point of the port is to have less C to allow more users to hack on the internals.

I think Gerbil probably has the best macro support, and racket's are really good too.
The real win in CL I think is the high-quality implementations with full-powered compilation stacks (i.e. really good ability to observe the program at various stages, from macro-expanded to il to native asm; really good restarts and debug facilities, very fast and high-quality gc's making it almost suitable for soft realtime applications, etc.)
There's surely a way to get unhygienic macros in hygienic systems and vice-versa.

Is there a lisp without ((()))

No, it's the point of Lisp.

>dynamic types
No thank you.

python gives you the best of both worlds

>he literally believes Lisp generates code

Attached: 1516892477021.png (862x444, 139K)

It's much faster than racket currently in cases that aren't bottlenecked by the current lack of cross-module optimizations. What's slower is compilation speed. See youtube.com/watch?v=t09AJUK6IiM
It's true that the MAIN goal is maintainability, not performance, but performance is still a benefit that they're pursuing. See
groups.google.com/d/msg/racket-users/MKJ4Kdy30YY/elZwCG6BAQAJ

Not him but s-expressions had always make more sense to me. I don't know why but it's fucking simple and yet so complex. Compare that to an atom if you will, quite simple but you can rearrange them and create most complex structures. There's beauty and power in such minimalism.
See for new programmers... Well and old who grew up on Java, Python, C++.... To them it's scary if there's no libraries they need, there might not even be a tool to do specific job, so they quit.
They quit without realising that you can create tools, libraries and everything you need so easily that it's not even funny.
So why are they so afraid to expand their mind? Why do they have the need to play with puzzles somebody else wrote, thinking in language that forces you to think the same way?
Lisp is the ultimate meta-programming language, change the way you think about programming and embrace the enlightenment

Racket supports infix notation as a language spec. Otherwise, there's OpenDylan, which is basically lisp (complete with a CLOS-like object system and hygienic macros) with an infix syntax.

But ((())) kills my boner

I don't the point of posting that image. Lisp literally has linked lists as its primary data structures. The whole thing is built atop pointers. Can you into Lisp at all? Do you even know what a cons cell is?

I mean more like F#

>Racket supports infix notation as a language spec.
How does that look?

docs.racket-lang.org/sweet/index.html
ML-style syntax is a thing of its own. C isn't full of ((())) is it?
There are no lisps with that syntax as far as I know. Maybe a ML-class language like sml, ocaml or haskell would be more to your taste.

The latest revelation about common lisp I had was realizing that the number after the symbol name in the REPL and inspector is actually a pointer to a memory location, and that setf is only used to write values to memory addresses which is what every setf-able accessor actually returns.

who is this qti3.14?

>When racket-on-scheme happens, CL will die.
>Racket
>he can't dynamically redefine functions, methods, classes at runtime in his long-running program

according to who?

how would you go about it?

racket is statically typed

Statically types variants of Racket exist. Base Racket is dynamically typed.

For the guys like you there's always
3=====D~~~

ok... but I won't get the lisp experience then

what is the CL debugging environment like?
i use clojure a bit for work and the cursive debugger is ok but fucks up whenever you're using macros
what does paying $5k for a CL license get you that clojure doesnt give you for free?

>what are abstractions
you dont physically instruct the DMA controller to write to disk when you save a file do you?

It's impossible to get the lisp experience without the parentheses, though. The parentheses are precisely what makes the lisp experience a possibility in the first place. If there are properties of lisp that you care about that aren't REALLY the lisp experience then asking people to read your mind about it is not going to help anyone.

Why would you pay for a cl license when the best cl implementations are free?

Wow this is wrong on so many levels. Lisp can deal with pointers if you want to, but you need to realise that this doesn't look like your language.
Why is that hard to understand? Primary data structure points to certain place in memory. And you can manipulate such structure the way you see fit.
Naughty dog (game studio) made games with lispy language. You are confined in your little box of thinking what "real" programming is. And, as long as you are a fanboy of certain technology, IDE, text editor, lose the attitude kid, because you are not real programmer.
Have a nice day m8

>You are confined in your little box of thinking what "real" programming is, you are not real programmer

>show me a text editor entirely written in lisp
>links an os (which still requires the runtime to run, and is not even in pure lisp)
The absolute state of lispfags

ND didn't REALLY use lisp per se for their games. They used lisp-like representations and compiled them to some target (native for j&d, c++ for the later games where they used it only for 'scripting').

so why would anyone buy a $5k lisp license at all? i assumed the best environments must be proprietary

>why no binaries?
>Unfortunately, whatever I supplied, people wanted something different! Be it a newer version of CLISP, an older version of CLISP, SBCL on Windows or 32-bit CCL on OSX. Unfortunately I just don't have the time to make everyone happy so now I provide only the source code. As ABLE is just a Common Lisp library, anyone who's managed to set up a Lisp compiler and ASDF can be up and running quite quickly.
Kek.

Same reason some people use spss or most mass spec software is proprietary and shitty: some classes of people have this weird impression that if it's proprietary and closed source the quality must be higher and there must be guarantees on how well things work. Meanwhile legal departments are happy because if something goes wrong they can blame the company behind the proprietary solution.

I guess operating systems aren't actually written in C because they use some assembly.

imo clojure's usage of [] in forms such as let is superior

(let [hello '(println "hello world")]
(println hello)
(eval hello))


compare to

Can you pass args into the list to make the eval non trivial?

They also don't require a separate runtime environment to actually run.

Yes. It can be any list.

Python can do that too.

Up to your taste. You could write a macro for it in any lisp. I think () is better because it's more consistent, but I think the racket approach ([ and ( is equivalent so you do (let [(hello 'something) (world 'something-else)] ...)) is a decent compromise.
When you `let` a single variable it can seem cumbersome, but most of the time you'll be `let`ing a few things and then it will make the clojure version look weird.

Are IDE's usually written in the language they are made for, or are they just made in C /++? Sounds like lisp could be used to make it's own IDE pretty trivially.

True, but building such a construct interactively is much harder in python since you have to keep track of syntactic constructs, whereas you just imbrick s-expr's in lisp.

github.com/froggey/med
Here's a text editor, for said OS.
In pure lisp.

Also, there isn't a single operating system for x86 that doesn't include ASM. There's MenuetOS which is pure ASM, and there were lisp machines with their special hardware.
A runtime is obviously required to run something. That your OS provides a runtime for your applications and you're not even aware of it doesn't mean that it's somehow not there.
And obviously you need a compiler to fucking compile software.

Emacs.

it doesn't look weird, most people adhere to the convention of one binding per line, so it's always going to look like

(let [foo bar
baz quux]
(do stuff))


*shrug* imo easier to read.

I've always just considered emacs a text editor. Have I not gotten good enough? I have never read the tutorial.

And in my opinion, harder to read.
You can also put bindings on one or multiple lines at will when they're delimited by ()'s, without sacrificing readability, which is a big part of why I prefer the (())-let.

DrRacket is written in Racket. Eclipse is written in Java. IDLE is written in python.

Yes, read that to yourself a few times pajeet.
Lisp is flexible language, so flexible in fact that when you approach a problem you can easily make DSL that solves that problem even if original spec never imagined such thing.
Good luck with your productivity trying to do that in any other language.
But hey, people in your village must be impressed with your mastery of putting fucking lego bricks one on top of the other to make shit work.
That's like so hard Rajesh I bet your app will be famous...

You missed the point entirely, do you even know what design of programming language even is?
You are way over your head here and I get it but at least try to learn something new will ya?

clojure dev here. can honestly say i've never had to implement my own DSL

however, compojure's REST DSL is fucking tasty

Attached: file.png (484x168, 23K)

>what is the CL debugging environment like?
a nice feature is interactiveness.
suppose you're drawing an animation using SDL and a condition (an error) arises somewhere in down in one of your drawing functions.
you get a stack trace and a repl, you can inspect and set variables with that, you can jump back into the editor fix your function and you should be able to resume the animation loop with the new function
although in practice, in the case of SDL at least, one has to use a wrapper macro somewhere up in the main loop to have it pause on conditions, i think

>his language is made by a jew

They went to only scripting in lispy language when Sony bought them so they could integrate more easily with the rest of the team.
And don't mix up the target arch with language.
There are many lisps/schemes that compile to native C.
Only thing here is that you can have one fucking guy doing the same work as 15 C "engineers", since we all using the same compiler to produce the machine code, why that ego that you are somehow better for taking the longer and more bug ridden code?
It goes through the same fucking compiler and compiler is doing the optimisations even if you set them manually.

I personally setup emacs with the appropriate packages and go, the only time I found emacs not as comfy is when doing java (yuck~). In everything else emacs came out a champ, including some esoteric shit I found myself writing elisp for, for example tagging a huge media and photo library.

>To them it's scary if there's no libraries they need, there might not even be a tool to do specific job, so they quit.
Same for Lisp, though. Try to implement graphics without any external library.

>needing graphics