« first day (1281 days earlier)      last day (3669 days later) » 

6:00 PM
LOL
 
I mean: make up your mind. Without a goal it's always a failure, whatever comes out
 
intermediate .net ---> IL
@sehe:
compiled language named LUpe
Lupe*
Being parsed with the syntax mentioned
That is my goal
 
@SuperCookie47 I'd make your own bytecode, make it much simpler, and interpret that. That's simplicity
 
I really want it to be compiled though
 
also: you're not tied to any particular VM. You could port it to your arduino
@SuperCookie47 Pro tip: you can compile bytecode too! And it's much easier, usually
 
6:02 PM
can any processor read bytecode? isn't it custom bytecode?
 
user1804599
You can write your own VM.
 
or is it just the basic instructions?
 
user1804599
It’s fucking easy, really.
 
VM = no no
 
user1804599
6:02 PM
Then why do you generate IL?
 
In computer programming, object orgy is a term, common in the Perl programming community, describing a common failure (or 'anti-pattern') in object-oriented design or programming. In an object orgy, objects are insufficiently encapsulated, allowing unrestricted access to their internals, usually leading to unmaintainable complexity. Consequences The consequences of an object orgy are essentially a loss of the benefits of encapsulation: * Unrestricted access makes it hard for the reader to reason about the behaviour of an object. This is because direct access to its internal state mean...
8
My new favourite anti-pattern!
 
I want it to be compiled, just like C++
independent of framework, can run on anything
 
user1804599
C# is also compiled … to bytecode.
 
platform indepenant
 
@sehe hahahahah
 
6:03 PM
independent*
 
@SuperCookie47 it can be. the point is, don't trouble yourself with the accidental complexities of a target machine (virtual or non-virtual)
 
user1804599
Guys.
 
on a remote server, is there a way to make a script which configures the crontab on deployment?
 
user1804599
Help me pick a programming language.
 
No.
 
user1804599
6:04 PM
I can’t choose!
 
machine code, bytecode?
 
@rightfold You already picked most of them. You will leave at least 3 or 4 for someone else to pick
 
@rightfold IO Io
 
user1804599
@sehe lol
 
user1804599
@StackedCrooked Do you mean Io?
 
6:04 PM
yes
 
@rightfold Assembler
 
user1804599
An assembler is a program.
 
assembler is not a programming language
 
Fuck you!
I love you, really :)
 
user1804599
@StackedCrooked I have never used it. How small is the ecosystem?
 
6:06 PM
I dunno anything about it myself.
 
user1804599
Oh. :P
 
user1804599
Wait, I know.
 
user1804599
I will write an interpreter for a language I have thought about ages ago. It’s the simplest possible thing ever.
 
user1804599
It’d be done in like, two hours.
 
nil is dangerous, and Io seems to have it
in fact, the print function returns a nil
 
6:08 PM
how would one translate/compile their bytecode program down to machine code :o
if i used bytecode
 
user1804599
Instruction by instruction.
 
especiallysince bytecode is custom
 
is someone particularly inspired to talk about monads for 10 minutes?
 
nomads/
?
lol
jk
 
hope so ;)
 
6:10 PM
@rightfold yet you will fail to do so
 
user1804599
No!
 
user1804599
I already wrote a main function. :L
 
one step closer
 
@SuperCookie47 how can you take that line of reasoning and expect to compile "source code" to machine code? I mean, source code is not even custom bytecode. It's custom custom custom custom custom bytecode, really
 
That's what I wondered. Converting from sc to mc would be impossible (almost)
What is C++ first compield to, for example?
bytecode?
 
6:13 PM
@SuperCookie47 So, compile sc -> bc first. Then you'll know (a) it's not that hard (b) what it takes to bc -> mc
 
@SuperCookie47 clang does use LLVM bytecode (IR) but other compilers generally don't.
One could argue that they all use some intermediate form (AST, Gimple whatnot)
 
C?
I suppose they're pretty much the same
As far as compilation is concerned
 
Yup
C++ will usually have *many) more stages. But in general it's the same
 
how would "int z=342;" translate to an example bytecode
 
6:15 PM
Fun Fact: The first C++ compiler(s) was actually a frontend that translated into C code
@SuperCookie47 push 342 or stoi $1, 342 (i.e. push onto stack (for a local var) or store integer into location $1)
 
what language is that>
?
isn't that asm?
 
@sehe or even nothing, no?
 
@Jefffrey no, that's optimization, not code generation.
Don't mix up even more conceptual steps :)
 
aren't they assembly.?
 
I see
 
6:17 PM
@SuperCookie47 It's your bytecode! You make it up
 
why create tokens if you are going to create bytecode?
couldn't you just skip the step?
 
So, depending on how you want the code to be represented for execution, you define the operations that you need.
 
Why do you want to translate byte code to machine code? Are you writing a JIT compiler?
 
@SuperCookie47 that's completely orthogonal
@FredOverflow that's off -topic now, I guess
 
@sehe Why?
 
6:18 PM
Basically, I think that Machine Code is all a processor can deal with
... no?
/
That's why i want to translate to that
 
@SuperCookie47 yes, you can always skip the lexer. You can even skip the AST (MSVC does...) and stuff. But the layering helps keeping the complexity down. And depending on the grammar, lexing can improve parser performance
 
@SuperCookie47 Are you writing your own VM?
 
virtual machine meaning?
 
@SuperCookie47 Of course. But, it's also good to realize that Machine Code is /just/ a byte code. It just so happens to be one that the physical processor knows
 
so could i first compile to asm instead of bytecode?
isn't this basically a byte code?
 
6:21 PM
@SuperCookie47 Here is a Java program:
public class SuperCookie47
{
    public void method()
    {
        int z=342;
    }
}
And here is the bytecode for that:
Compiled from "SuperCookie47.java"
public class SuperCookie47 {
  public SuperCookie47();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public void method();
    Code:
       0: sipush        342
       3: istore_1
       4: return
}
 
dat class name
;)
since i don't understand java...
but i get the idea
 
How can you not understand Java when you specifically asked about int z=342;???
 
so theoretically, I could translate first to asm instead of a custom bytecode?
this would make it easy to port for different architechtures?
architectures*
 
asm is architecture-specific
So compiling to asm is pretty much the opposite of getting a portable result.
 
but i mean, if i was re-writing the compiler for a specific arch. then i could change the minor differences such as integer size tc. on that arch. (specific asm)
 
6:24 PM
Assembler languages differ much more than just by register sizes.
 
user784668
Yay, Chelski got Sunderlanded!
 
i see
but translating the asm to different arch. would be easier than a different bytecode?
since asm can be directly compiled to machine code, wouldn't this eliminate a step of translating from bytecode to mchine code manually?
Supposing asm does compile to machine code :O
 
Translating from one asm to another asm is just stupid. What you would do is write another back-end that spits out the asm of your choice.
asm is a human-readable version of machine code.
 
@FredOverflow "Translating from one asm to another asm wouldn't work"*
 
user784668
Is Sunderland owned by Liverpool or something?
 
6:27 PM
but wouldn't i have to eventually translate from my custom bytecode to machine code??
 
I'm still unclear why you're asking all these questions in the first place. Maybe you should buy a compiler book?
Please explain what you're trying to do. Do you want to invent and implement your own language?
 
Yes,simply put
But i have read such books. they only provide general information, and areusualy language and implementation specific etc.
I need real help, specific tome
to me*
 
Then buy "Language Implementation Patterns", "Engineering a Compiler" or "Compilers: Principles, Techniques and Tools".
oh
 
I have an idea. Can someone map the minimal basic steps of going from SOURCE CODE>MACHINE CODE (the minimal amount of step)
 
user784668
Minimal?
 
6:30 PM
like source code>token liss>ast>bytecode>machine code
idk, that's why i iam asking
 
user784668
Sure. Create a machine that runs the source code natively.
 
list*^^
 
If you want to edit an old message, just press "Cursor Up".
 
and how would i make it platform agnostic?
platform independent i should say xD
 
Don't get ahead of yourself. First, you would write a compiler that works for one platform. In the process, you will learn so much that all other questions you might come up with right now will be have been rendered irrelevant by then.
 
6:32 PM
but it would save a lot of time if i knew enough to make the most basic, platform independant one right off the bat
 
Also, you probably don't want to write your own optimizer and back-end. You may want to look into LLVM.
 
then i could begin expanding my language
without having to re-writeit
 
LLVM (formerly Low Level Virtual Machine) is a compiler infrastructure written in C++; it is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. Originally implemented for C and C++, the language-agnostic design (and the success) of LLVM has since spawned a wide variety of front ends: languages with compilers that use LLVM include ActionScript, Ada, D, Fortran, OpenGL Shading Language, Haskell, Java bytecode, Julia, Objective-C, Python, Ruby, Rust, Scala and C#. The LLVM project started in 2000 at the Unive...
> LLVM can provide the middle layers of a complete compiler system, taking intermediate form (IF) code from a compiler and emitting an optimized IF. This new IF can then be converted and linked into machine-dependent assembly code for a target platform. LLVM can accept the IF from the GCC toolchain, allowing it to be used with a wide array of extant compilers written for that project.
 
i want everything to be my own
without any frameworks etc.
 
user784668
Why?
 
6:35 PM
because that's why i am making it
 
Then start making it and stop asking questions.
 
if there was a "langauge creator" i wouldn't use it
so stackexchange should be shut down
 
user784668
@FredOverflow Perhaps he's scared of the possibility of learning something in the process?
 
no need to ask questions
perhaps you don't need to talk indirectly?
 
If you really want to know everything there is to building your own multi-platform compiler from scratch, this is going to be a VERY long night. I guarantee nobody in this room will be able to invest the necessary time.
 
6:37 PM
that's why i asked, ot be led in the right direction: what are the minimum steps?
source code to machine code
absolutely necessary steps
 
You already answered that yourself.
And every book on compilers will tell you.
 
realistically, do i seem like someone who could compile my source code directly to mc?
realistic steps?
 
user1804599
Lex, parse, resolve names, check types, do any other analysis required, generate low-level representation, optimise low-level representation, translate to target language.
 
target language being machine code..?
as in the last language?
 
user1804599
Whatever you want.
 
user1804599
6:38 PM
JavaScript seems to be popular these days.
 
well i want the my source code to be able to be compiled, so that it can run on anything witha cpu
like c++
 
Guess what: clang, arguably the best C++ compiler, uses LLVM :)
 
such as windows and arduino lol
 
Windows has a CPU?
 
pc, then
 
6:40 PM
I was not aware that Windows was a processor architecture.
 
i was not aware that people jump on such mistakes
 
well I'm glad to have corrected you
 
:)
:O see!
 
^ Windows CPU
 
6:41 PM
I told you
;)
 
personally
my language targets LLVM IR
 
well, arduino isn't a cpu architecture either but...
 
good dog
 
and I'm pretty happy with the range of targets available.
 
which are?
 
6:42 PM
x86/64, ARM & ARM64, PPC, Itanium, and a few more
 
> At version 3.3 LLVM supports many instruction sets, including ARM, Hexagon, MBlaze, MIPS, Nvidia PTX (called "NVPTX' in LLVM documentation), PowerPC, R600, SPARC, z/Architecture (called "SystemZ" in LLVM documentation), x86/x86-64, and XCore. Not all features are available on all platforms; most features are present for x86/x86-64, z/Architecture, ARM, and PowerPC.
 
what about arv?
 
arv?
 
Never heard of arv.
Fuck my space key seems to be broken.
 
apparently arduino's Atmel processors are such???
I could be wrong
 
6:43 PM
they will be ARM.
 
> Arduino is a single-board microcontroller, intended to make the application of interactive objects or environments more accessible.[1] The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM.
 
so, avr, then
at least the Uno is
 
lol 8 bit
 
haha ino
 
6:45 PM
Do you really want to write a compiler that targets an 8 bit CPU?
 
@ScarletAmaranth Nisekoi was great as usual.
 
but they're fun to use and experiment with, regardless
 
yeah... I doubt anyone is using the 8-bit microcontroller.
 
not but, if i wrote it for 86x/64x, ARM I would be happy
 
pretty much all the architectures are dying out except for ARM and x86
 
6:46 PM
WITHOUT using LLLLVMMVMVMMVMVM or whatever?
 
hah
 
64x isn't dying out!
 
it would take you a lifetime to produce anything like decent code.
 
decent code?
 
@SuperCookie47 x64 is just the 64bit version of x86, it's not a different architecture.
 
6:47 PM
machine code?
 
@StackedCrooked dayum; I still have FT and Nisekoi unwatched; sod this
 
user1804599
Time to write Clojure code again.
 
@SuperCookie47 Decent code is code you can present to your peers and parents without being ashamed.
 
user1804599
Fuck non-Clojure languages.
 
@rightfold fanboi
 
user1804599
6:48 PM
:3
 
@FredOverflow source code or machine code?
 
both.
 
i.e. the beginning code or the compiled code
so you are basically saying that my syntaxis crap?
that's all you know of my language?
 
@SuperCookie47 ALL CODE MUST BE BEAUTIFUL OR I WILL HAUNT YOU IN YOUR SLEEP
 
I officially hate people :P
 
6:49 PM
and it's pretty much c syntax so...
 
wat.
 
@user1326876 good
 
@SuperCookie47 What are you talking about? I haven't even seen your syntax.
 
user1804599
I want to write something fun.
 
But why does the world need another C-like language?
 
6:50 PM
then how can you tell what my code will look like...
 
there's a thousand light-years between the input syntax and the quality of compiler implementation and generated code.
 
I've just had to listen to someone talk about how Qt is going to take over C++.. I wanted to cry :(
 
user1804599
Weakling.
 
@SuperCookie47 What we are getting at is: when you use LLVM, the generated machine code will be optimized to death. When you generate your own machine code, it will be embarassingly naive. Unless you are willing to put many years into writing all the optimizer stages by hand.
 
@user1326876 There, there. Here's a tissue. You can always work on one of the numerous C++ successors around.
 
6:51 PM
but is LLVM a program, language, framework??
 
@DeadMG I thought C++ had everything going for it :'( shall I turn to HTML? (laughs)
 
@user1326876 C++ is a dead horse, dunno why people keep beating it.
 
@SuperCookie47 What is stopping you from typing LLVM into Google?
 
will it only be used to compile the final parsed code?
 
@DeadMG Might download Qt.. ngl
 
6:52 PM
@SuperCookie47 Didn't we already post that? Here it comes again:
> LLVM can provide the middle layers of a complete compiler system, taking intermediate form (IF) code from a compiler and emitting an optimized IF. This new IF can then be converted and linked into machine-dependent assembly code for a target platform.
So you would write a compiler that spits out LLVM-IF, and then LLVM optimizes it and spits out machine code.
Now please don't ask me about the details; I have never done it.
Just try it and learn through the experience.
 
LLVM IR, actually.
 
@DeadMG More context please, where was I wrong?
 
well, I dunno who the fuck uses "intermediate form", but the technical term would be intermediate representation, or IR.
at least, I have never ever heard it described as IF and all the LLVM documentation calls it IR.
 
The Wikipedia article does not contain the word IR.
oh ok
 
gosh, Wikipedia being wrong? who'da thunk
at least, I'd expect that it's one of those things where about 500 people came up with the same idea simultaneously and gave it a different name
so it's more of a implicit consensus/most commonly used thing, I'd guess.
really, you generate LLVM IR, then LLVM optimizes the IR and then you can output it in the intended native code format.
 
6:57 PM
if there's confusion among you evidently learned people, God help me..
 
there isn't really confusion, it's the Wikipedia article that's incorrect.
(plus, as per Fred's own admission, he is not learned about LLVM)
 
@SuperCookie47 the absolutely necessary steps are: 1. you write the code to write the target object file. 2. ???? 3. Profit
 
Have you read Let's Build a Compiler?
> This fifteen-part series, written from 1988 to 1995, is a non-technical introduction to compiler construction.
 
so what form does the LLVM take? c++ code that does this, a program that takes the code as an argument LOL???
 
Why don't you just read the documentation?
What benefit do you get by asking us?
 
6:59 PM
reading requires effort, asking you does not
 

« first day (1281 days earlier)      last day (3669 days later) »