« first day (209 days earlier)      last day (748 days later) » 

12:57 AM
@Downgoat oops sorry copied and didn't finish modifying
 
1:44 AM
@ASCII-only oh ok
please ping when fix
 
2:00 AM
@ASCII-only :O GOT LLVM ADDITION THING WORKING NOW ONLY HAVE TO CONNECT BUTTON
@ASCII-only btw pls come on have important question aobut VSL development
 
@Downgoat ok
 
@ASCII-only so it turn out type deduction is very hard
and I don't want to spend weeks on a constraint & solver system only to recode it in cheddar
so I think we should not do type deduction in first version
 
@Downgoat hmm ok
@Downgoat ok
 
Also we're going to need to design a VSL ABI sooner or later but right now I'll just make it compile to C-like functoins
e.g.:
class Animal {
    let name: String
}
would compile to LLVM equivilent of:
struct Animal { String name; }
Animal Animal_init(Animal self, String name) { ... }
Animal(name: "foo") then would be:
Animal animal = malloc(sizeof(Animal));
Animal_init(animal, "foo");
 
2:16 AM
@Downgoat don't you have to malloc foo as well
 
yes
but example
So we're going with UTF-8 which will mean we'll likely need to classes along the lines of:
class String { i8* bytes; size_t len; }
class CharacterView { String* string; }
A CharacterView would handle emojis and all
so e.g. directly doing "<goat emoji>"[0] might give some weird unicode character
but CharacterView would align everything
 
@Downgoat 0/10
 
additionally it would provide a real length of the string
you wouldn't have to actually touch characterview
 
imo there should be string, ascii string and cstring
 
this is just internal implementation
 
2:19 AM
oh so llvm string = cstring, llvm charview = string?
 
not a C-String as those are null-terminated and here we keep track of length
but same concept
 
hmm imo we need cstring as well
 
yeah definetly
I was thinking we would implement Standrad library in VSL itself
we can link libc for basics
 
@Downgoat Animal*?
 
it was pseudo-code i know not valid
@ASCII-only the good part about a CharacterView kinda thing is we could have like a StringView interface and the user can implement that to use whatever encoding they want
actually CharacterView might be the interface and we'd have UTF8View and maybe ASCIIView and UTF16View
btw I was testing opt and looks like we shouldn't need to worry too much about stuffs:
opt test.ll -S -always-inline
; ModuleID = 'test.ll'
source_filename = "test.ll"

declare void @foo(i32)

; Function Attrs: alwaysinline
define i32 @"class.Int.=="(i32, i32) #0 {
entry:
  %2 = add i32 %0, %1
  ret i32 %2
}

define i32 @main(i32, i8**) {
entry:
  call void @foo(i32 2)
  ret i32 0
}

attributes #0 = { alwaysinline }
@ASCII-only so for first VSL. 1 will always be integer. 1.0 to distinguish as double
@ASCII-only btw can you fix nearley when you have time
@ASCII-only btw syntax errors in the JS too
Question: is it possible to get argc/argv by gazing at memory?
If I store pointer of argc, will argv be adjacent to it alwyas?
 
2:46 AM
@Downgoat kinda
@Downgoat no argc is arg count
 
3:05 AM
@ASCII-only yes but it's pushed into the stack first
 
@Downgoat wait really
@Downgoat then yes
 
3:44 AM
@Downgoat ok what do i do
@Downgoat ok what bork
@Downgoat where
 
@ASCII-only do npm run dev
 
 
5 hours later…
8:47 AM
@Downgoat sorry fix now
@Downgoat btw had to comment out unfinished thing in scopetraverser
 
 
7 hours later…
4:03 PM
@ASCII-only okay, I think I figured out how to do compilation, there's one thing though, we need to be able to parse C's .h files and convert them to a Cheddar file
can you do that?
e.g.:
 int add(int b, int c)
becomes:
func add(b: Int, c: Int)
you could just convert it to a VSL AST
that way we can just do:
import header "glibc.h"
then we have all glibc function
wait nevemrind
hm
subscripts could be inlined
btw we might want decorators:
e.g.:
 @opt(size) @request(inline)
  func add() {}
which would put the LLVM attribute for optsize and inline
or similar syntax
@Downgoat shit mean VSL
I'll avoid premature optimization for the scope lookup
but note to future goat: OPTIMIZE THE DAMN SCOPE LOOKUP
2
@ASCII-only ambiguty: is () => {} lambda return empty set or lambda with empty body
@ASCII-only parser borked retunring undefined
@ASCII-only pls fix expressions very bork
also pls do lot test
also type not working
@ASCII-only pls cannot do scope & generation without
 
4:40 PM
Let me setup glibc
 
 
3 hours later…
7:11 PM
@ASCII-only do we want to have embedded LLVM?
e.g.:
func add(a: Int, b: Int) -> Int llvm {
entry:
    ret add (i32 %0, %1)
}
so Pointer class could be implemented as:
public class Pointer<Type> llvm {
     layout { <Type> }
     define @<Name>.method.dereference() {
     }
}
Where <Name> is the mangled name of the class
@RO can you move to VSL room
hm, can we add this syntax to class:
public class whatever(foo) -> bar llvm {
     layout {  }
     define <stuff>
}
where layout contains a comma-seperated list of identifiers
and define is .+\{\}
we don't have to implement LLVM parser
just be able to extract define stuff and contents of layout
We can do a find/replace to replace <Value> with the mangled name
 
Anonymous
7 messages moved from The Nineteenth Byte
 
thanks :D
or actually just methods:
 func whatever(types) -> ReturnValue llvm { llvm code }
example:
public class Pointer<T> {

    public func dereference() -> T llvm {
    define <returnType> <name>(<returnType>*) alwaysinline {
    entry:
        %1 = load <returnType>, <returnType>* %0
        ret %1
    }
    }

    public func getptr(at: Int64) -> Pointer<T> {
    define <returnType> <name>(i64) alwaysinline {
        %1 = getelementptr <returnType>, <returnType>, i64 %0
        ret %1
    }
    }

}
where compiler replaces Pointer<T> with T*
 
 
3 hours later…
10:53 PM
@Downgoat empty body, ()=>{{}} return empty set
@Downgoat ono
@Downgoat hmm i was thinking vsl functions to generate llvm instead
 
@ASCII-only yeah that's what I end up doing
see libraries/ foldrr
Ive been writing LLVM for VSL
 
inline fn <returnType> <name>(at: Int64) --llvm {
    result = getelementptr <returnType>, <returnType>, i64 %0
    return result
}
 
how exactly how will have to work
example pointer class:
/**
 * A primitive class representing a low-level pointer object. The pointer class
 * is an akward class in the sense it has a bunch of compiler glue to make it
 * functional.
 *
 * This definition only offers to specify the behavior of _functions_ of Pointer
 * instances. No fields exist because the generated code for `Pointer<id>` is
 * always `(id)*`.
 */
public class Pointer<T> {

    public func dereference() -> T llvm {
    define <returnType> <name>(<returnType>*) alwaysinline {
    entry:
basically we need two things
1) A VSL signature (like header file) so VSL knows types and all at a high level. 2) actual LLVM code to literally insert
<...> are macros which are find/replaced with specific strings
 
@Downgoat D: macros
 
@ASCII-only ?
pls suggest alternative
 
11:02 PM
@Downgoat how exactly to fill in macro
 
unless you want to have a symbol hashtable which is looked up dynamically this best way
@ASCII-only meaning?
just basic find/replace
 
at compile time?
 
yeah
do note: this is libvsl
so it will be dynamically linked
so not actually compiled at compile-time
it is already compiled
if you want we can write really basic LLVM tokenizer
but too complex
why not just do llvm _ "{" [^}]+ "}"
keep it simple
btw added libc bindings in libc.vsl
@ASCII-only can u come onto c9 btw
 
11:30 PM
@ASCII-only ono where u go
 
@Downgoat idk
 

« first day (209 days earlier)      last day (748 days later) »