Programming thread

Should I learn React Native?

I'm planning a static website thing that sucks in and reformats a different downloaded webpage for the user when loaded. My concern is if I use a bunch of JavaScript libraries in the program, will they be able to run of the users browser or are those React libraries tied into the server running React? I don't know if in React websites the JavaScript can be made to run on the client side for a static loading site.
 
Should I learn React Native?

I'm planning a static website thing that sucks in and reformats a different downloaded webpage for the user when loaded. My concern is if I use a bunch of JavaScript libraries in the program, will they be able to run of the users browser or are those React libraries tied into the server running React? I don't know if in React websites the JavaScript can be made to run on the client side for a static loading site.
React Native is for making mobile apps. It sounds like you’re trying to make a server-side app that uses React? There is server-side rendering you can do with React but I am not sure what that would get you in this case. If you’re just sending a static page back then why bother with JavaScript at all?
 
I'd agree with @Spasticus Autisticus . I'm not really sure why you need to even have a static webpage that sucks in the other sites, tbh. Sounds like this could be something ran just as an endpoint or even a command-line program. If your concern is post-dom javascript manipulation of page elements, then you could always load it with a headless webdriver, or tap into a DOM loader.
 
Working on my language again, this time I'm starting with the actual execution model instead of starting with the types. Progress is going pretty good so far, haven't implemented any memory management (I've decided to patch the leaks later with GC lol), but I've got a bunch of expressions working and most of the type system after only about a week.
Here's the basic plan, the language's runtime form is an AST where every expression is a 2 tuple, the first element being the verb (function) and the second being the subject (argument) (I was pretty heavily inspired by Nock). One of the cool things I like about my design so far is that code is mixed with data seamlessly, and meta-programming becomes completely natural.

Example which culminates in fib
Ruby:
TupleEvalInner = (Func t
(Eval                        # (Eval)uate evaulates the expression returned from Cond
  ((Cond (IsEmpty t))        # (Cond)ition returns a function that picks the first or second element of a tuple
   [[]                        # Return empty tuple if empty (Tail returns empty if input is a 1-tuple or empty)
    ((Cat                    # Recursively con(Cat)enate the Eval of the tuple elements
      (Eval (Head t)))
     (TupleEvalInner (Tail t)))])))

TupleEval = (Func t            # Elements of tuples are not implicity evaluated, so a function which does this is desirable
(Eval
  ((Cond (IsTuple t))        # Check that the input is a tuple
   [(TupleEvalInner t)        # Evaluate the tuple recursively
    (Tup (Eval t))])))        # Or, Evaluate the value and put it in a 1-tuple

TupleApply = (Func f        # With TupleEval, we can create a more typical multi-arg call function
(Func t
  (f (TupleEval t))))        # Evaluate f against the evaulation of tuple t

Index = (Func i
(Func t                    # Produce a function which will index it's input by i
  (Eval ((Cond
    ((TupleApply Eq)        # Select the head if i is 0
     [i 0]))
   [(Head t)
    ((Index (Dec i))        # Recursively index with t = (Tail t) and i = (Dec i)
     (Tail t))]))))

FibonnaciInner = (Func t
(Eval ((Cond
   ((TupleApply Eq)            # Return t.1 if t.0 (the index) is equal to zero
    [((Index 0) t) 0]))
  [((Index 1) t)
  ((TupleApply FibonnaciInner) [
    (Dec ((Index 0) t))        # Recursively call with t = [(t.0 - 1) (t.2) (t.2 + t.1)]
    ((Index 2) t)
    ((TupleApply Add) [
     ((Index 1) t)
     ((Index 2) t)])])])))

Fibonnaci = (Func i
((TupleApply FibonnaciInner)
  [i 0 1]))


# General syntax
# Function invocation (all functions are unary)
(Func Value) => (Invoke [Func Value])

# Invocation with a Null function results in the argument
(Null Value) => Value

# The (Eval)uation of an (Expr)ession is the Eval of it's verb invoked on the Eval of it's subject
(Eval (Expr [Verb Subject]) => ((Eval Verb) (Eval Subject))

# An Eval of an Expr with Null verb results in the unevaluated subject
# (Used for edge cases where you want to pass an expression)
(Eval (Expr [Null Subject]) => Subject

# The Eval of a value results in the value itself
# Functions and Null are considered values for this purpose
(Eval Value) => Value


# Special syntax
# (Ex)pression denotes that the subject should return unevaluated
(Ex Subject) => (Eval (Expr [Null Subject]))

# Brackets denote a tuple, (Tup a) creates a 1-tuple with a
[a] => (Tup a)

# Cat concatinates the elements of two tuples
[a b...] => ((Cat [a]) [b...])

# Create a function with an argument and body
(Func arg body)
# Functions are kind of WIP at the moment, I'm not quite settled on their runtime form, while the other elements translate pretty much literally to the AST
Who would have thought that ruby syntax highlighting would be just about perfect for this?

Now you might ask if this means I've seen the light and become a fp weenie... No. Despite the appearances the language is largely imperative :story:
Still a lot of work to do, but I feel like I'm making better progress than the last time I tried this. Ultimately I'm aiming for a mixed paradigm language that lets you be only as specific as you need to be, not quite duck-typed though, instead I'm hoping to have a interface/contract system that's not as restrictive and pedantic as OOP, but more specific than just looking up functions by name on a formless-mush-object.
 
Working on my language again, this time I'm starting with the actual execution model instead of starting with the types. Progress is going pretty good so far, haven't implemented any memory management (I've decided to patch the leaks later with GC lol), but I've got a bunch of expressions working and most of the type system after only about a week.
Here's the basic plan, the language's runtime form is an AST where every expression is a 2 tuple, the first element being the verb (function) and the second being the subject (argument) (I was pretty heavily inspired by Nock). One of the cool things I like about my design so far is that code is mixed with data seamlessly, and meta-programming becomes completely natural.

Example which culminates in fib
Ruby:
TupleEvalInner = (Func t
(Eval                        # (Eval)uate evaulates the expression returned from Cond
  ((Cond (IsEmpty t))        # (Cond)ition returns a function that picks the first or second element of a tuple
   [[]                        # Return empty tuple if empty (Tail returns empty if input is a 1-tuple or empty)
    ((Cat                    # Recursively con(Cat)enate the Eval of the tuple elements
      (Eval (Head t)))
     (TupleEvalInner (Tail t)))])))

TupleEval = (Func t            # Elements of tuples are not implicity evaluated, so a function which does this is desirable
(Eval
  ((Cond (IsTuple t))        # Check that the input is a tuple
   [(TupleEvalInner t)        # Evaluate the tuple recursively
    (Tup (Eval t))])))        # Or, Evaluate the value and put it in a 1-tuple

TupleApply = (Func f        # With TupleEval, we can create a more typical multi-arg call function
(Func t
  (f (TupleEval t))))        # Evaluate f against the evaulation of tuple t

Index = (Func i
(Func t                    # Produce a function which will index it's input by i
  (Eval ((Cond
    ((TupleApply Eq)        # Select the head if i is 0
     [i 0]))
   [(Head t)
    ((Index (Dec i))        # Recursively index with t = (Tail t) and i = (Dec i)
     (Tail t))]))))

FibonnaciInner = (Func t
(Eval ((Cond
   ((TupleApply Eq)            # Return t.1 if t.0 (the index) is equal to zero
    [((Index 0) t) 0]))
  [((Index 1) t)
  ((TupleApply FibonnaciInner) [
    (Dec ((Index 0) t))        # Recursively call with t = [(t.0 - 1) (t.2) (t.2 + t.1)]
    ((Index 2) t)
    ((TupleApply Add) [
     ((Index 1) t)
     ((Index 2) t)])])])))

Fibonnaci = (Func i
((TupleApply FibonnaciInner)
  [i 0 1]))


# General syntax
# Function invocation (all functions are unary)
(Func Value) => (Invoke [Func Value])

# Invocation with a Null function results in the argument
(Null Value) => Value

# The (Eval)uation of an (Expr)ession is the Eval of it's verb invoked on the Eval of it's subject
(Eval (Expr [Verb Subject]) => ((Eval Verb) (Eval Subject))

# An Eval of an Expr with Null verb results in the unevaluated subject
# (Used for edge cases where you want to pass an expression)
(Eval (Expr [Null Subject]) => Subject

# The Eval of a value results in the value itself
# Functions and Null are considered values for this purpose
(Eval Value) => Value


# Special syntax
# (Ex)pression denotes that the subject should return unevaluated
(Ex Subject) => (Eval (Expr [Null Subject]))

# Brackets denote a tuple, (Tup a) creates a 1-tuple with a
[a] => (Tup a)

# Cat concatinates the elements of two tuples
[a b...] => ((Cat [a]) [b...])

# Create a function with an argument and body
(Func arg body)
# Functions are kind of WIP at the moment, I'm not quite settled on their runtime form, while the other elements translate pretty much literally to the AST
Who would have thought that ruby syntax highlighting would be just about perfect for this?

Now you might ask if this means I've seen the light and become a fp weenie... No. Despite the appearances the language is largely imperative :story:
Still a lot of work to do, but I feel like I'm making better progress than the last time I tried this. Ultimately I'm aiming for a mixed paradigm language that lets you be only as specific as you need to be, not quite duck-typed though, instead I'm hoping to have a interface/contract system that's not as restrictive and pedantic as OOP, but more specific than just looking up functions by name on a formless-mush-object.
There I was thinking "this sounds like nock" then "I was inspired by nock". 10/10
I recommend not repeating the mistake Yarvin made with Nock and not tie the language implementation to data structure implementation details. Building everything with pairs is retarded. It makes the implementation easier and axiomatic, but if you don't care about it being axiomatic just screw it and add interfaces/protocols/mixins at the base of your language and define everything in their terms.
There aren't a lot of interfaces you need to cover - evaluation can be defined in terms of sequential access.
Eval f args = call f (map eval args)
For functions implementation you have to implement an environment somehow. Nock does it by just dragging along the entire execution context.
You can define an environment in a meta-circular way (but good luck with that shit)
Code:
;;; eval :: -> arg -> env -> result
(lambda (x) body) ->
(lambda (arg) (eval body (lambda (y) (if (= x y) arg (env y)))))
Or by specifying an execution context (i.e. VM, compilation, etc)
Which leaves one question - why a new language? Why not just a typed lisp?
 
  • Like
Reactions: world of shit
There I was thinking "this sounds like nock" then "I was inspired by nock". 10/10
I recommend not repeating the mistake Yarvin made with Nock and not tie the language implementation to data structure implementation details. Building everything with pairs is retarded. It makes the implementation easier and axiomatic, but if you don't care about it being axiomatic just screw it and add interfaces/protocols/mixins at the base of your language and define everything in their terms.
There aren't a lot of interfaces you need to cover - evaluation can be defined in terms of sequential access.
Eval f args = call f (map eval args)
For functions implementation you have to implement an environment somehow. Nock does it by just dragging along the entire execution context.
You can define an environment in a meta-circular way (but good luck with that shit)
Code:
;;; eval :: -> arg -> env -> result
(lambda (x) body) ->
(lambda (arg) (eval body (lambda (y) (if (= x y) arg (env y)))))
Or by specifying an execution context (i.e. VM, compilation, etc)
Which leaves one question - why a new language? Why not just a typed lisp?
The reason I'm writing every expression as binary, and every function as unary is that I want a single definition of function so as to avoid issues like C#'s Actions/Functions, and there's rather a pleasing symmetry to the idea that each function consumes one unit and produces one unit. Additionally, I want to be able to reason about function calls using the type system, so it's therefore convenient that both the inputs and outputs of functions can be treated as objects with their own types.
Differing from both Lisp and Nock however, I'm aiming to give the programmer more direct control of computational resources with concepts like structs, references, and both safe and unsafe memory management. Expressions taking the form of a cons is not representative of the general paradigm, everything is generally C like in terms of memory layout, and both tuples and expressions are actually just transparent structs.
The type system is a non-trivial feature, rather than have types as monolithic objects as is usually the case, types are broken down into classes which define individual aspects of the object. As an example, tuple becomes [ConcreteClass StructClass LocalMemClass], and for instance if you allocated one on the heap LocalMemClass would change to GlobalMemClass. The goal here is to make the notion of type much more flexible and modular, and eliminate all of the faggotry that OOP(s) induces, like for example C# has two separate types of tuple type and 8 variants for each of those 😩, one stack based and one heap based, fucking why? OOP(s).
 
Last edited:
C#'s Actions/Functions,
I searched for that and this popped up and I'm terrified to click it

1620280465884.png
 
Anyone have some good resources for learning Lua? I’m trying to pick it up over the summer for a bit of an autism project.
 
Anyone have some good resources for learning Lua? I’m trying to pick it up over the summer for a bit of an autism project.
Lua is a very simple language. The only potentially confusing concepts are metatables, 'environments' or if you're attempting to bind userdata with C. In pretty much all cases PIL will walk you through things.


If you are trying to embed lua into C/++, I do not recommend doing that manually. It's just a lot of labor and a lot of pain without a hell of a lot to actually learn. Use this instead. https://github.com/vinniefalco/LuaBridge
 
  • Thunk-Provoking
Reactions: Anon_Fluoride
I searched for that and this popped up and I'm terrified to click it

View attachment 2147071
He's gonna COOOOOOODE

1620281074303.png

Look at this shit ☝🏿 these are the 17 standard function types, but there's an entirely different class of functions called Action that differs only in that it returns void, and there's another 17 of those. Now, you can declare custom delegate types (think typedef for function pointers roughly), but different delegate types are entirely non-convertable even if the signatures match.
Basically all this is an incredibly ugly and retarded way of doing things. In C++ you'd just use template packs to encapsulate all 34 of these as a single meta-type, and in my WIP language you can do much the same by just specifying the arg types as a tuple, and null for void.

When the OOP hits 🤮🤮🤮🤮🤮🤮
1620282181715.png

Why yes, this faggoted list does contain 357 whole entries, very cool Java, very fucking cool!
 
Last edited:
Why yes, this faggoted list does contain 357 whole entries, very cool Java, very fucking cool!
Wait a minute, they re-implemented Excel function signatures? :lol:

xlfRegister (Form 1)
The pxTypeText argument specifies the data type of the return value and the data types of all arguments to the DLL function or code resource. The first character of pxTypeText specifies the data type of the return value. The remaining characters indicate the data types of all the arguments. For example, a DLL function that returns a floating-point number and takes an integer and a floating-point number as arguments would require "BIB" for the pxTypeText argument.
 
  • Like
Reactions: Strange Looking Dog
React Native is for making mobile apps. It sounds like you’re trying to make a server-side app that uses React? There is server-side rendering you can do with React but I am not sure what that would get you in this case. If you’re just sending a static page back then why bother with JavaScript at all?
I've never done any of this Node stuff before, so I don't know my ass form my elbows. I didn't realise react has so many different versions: native and js. I thought it was all just react-native. Usually I'd agree with you about scraping JS. Imagine a site like Invidious, but it loads like a web extension. It has to do all the logic client side, so I was originally thinking of using something skookum like react is meant to be. I've done normal JS in the browser before, so at first I was basing it around that; doing all the insert element and parsing. There are too many ties with running a server (a VPS), so doing the logic on a sever is out. I didn't know that with Node everything is assumed to be done client side, so by default what's done in a Node package is expected to be statically served and executed on the client.
 
I've never done any of this Node stuff before, so I don't know my ass form my elbows. I didn't realise react has so many different versions: native and js. I thought it was all just react-native. Usually I'd agree with you about scraping JS. Imagine a site like Invidious, but it loads like a web extension. It has to do all the logic client side, so I was originally thinking of using something skookum like react is meant to be. I've done normal JS in the browser before, so at first I was basing it around that; doing all the insert element and parsing. There are too many ties with running a server (a VPS), so doing the logic on a sever is out. I didn't know that with Node everything is assumed to be done client side, so by default what's done in a Node package is expected to be statically served and executed on the client.
OK, I think I see what you're trying to do. React would just be the piece that renders the output from your extension's parsing of other pages. You don't really need to use React since the page you are creating doesn't really have any dynamic state, which is where React is most useful, but it would work. I don't have any suggestions for anything more specialized to that use case though.

And let me try to clarify the whole Node/npm thing. Node.js is a server-side runtime environment, just like Ruby, Python, Perl, etc. npm is the package manager shipped with Node. The packages hosted on npm can be either node.js packages meant to be run in node.js, or client-side packages meant to be run in a browser, or environment-agnostic packages that have no dependencies on either environment. So normally in a client-side dev environment you'll have node.js and npm installed and you'll have a package.json file in your project that defines both your dev dependencies (build tools, linting, etc.) and your project's client-side dependencies (React, etc.)
 
Hey, that's Clojure!
It's not really that bad, you generate these interfaces once, automatically, then never look at them again. invokePrim's performance benefits are worth it. Yeah, it's not aesthetic, but it works.
COPE COPE COPE COPE COPE A lordly language wouldn't create a arbitrary distinction between so-called primitives and objects 😏


As I implement variables today I'm realizing that lambdas are going to be trickier than I'd thought, capturing environment is no trivial thing and to start with I think I'm just going to require a capture list to be passed into the lambda function, the awkwardness of this can be fixed in the compiler. One thing I haven't solved though is how to capture security context, and any other contexts, so far variables are the only context that's implemented and while they're all similar concepts, it's already pretty clear a capture list will be insufficient or at least there'll need to be a procedure for capturing other context information
 
COPE COPE COPE COPE COPE A lordly language wouldn't create a arbitrary distinction between so-called primitives and objects 😏


As I implement variables today I'm realizing that lambdas are going to be trickier than I'd thought, capturing environment is no trivial thing and to start with I think I'm just going to require a capture list to be passed into the lambda function, the awkwardness of this can be fixed in the compiler. One thing I haven't solved though is how to capture security context, and any other contexts, so far variables are the only context that's implemented and while they're all similar concepts, it's already pretty clear a capture list will be insufficient or at least there'll need to be a procedure for capturing other context information
Comes with the territory of working on the JVM
Can't wait for JEPs 401, 402, 405
 
Comes with the territory of working on the JVM
Can't wait for JEPs 401, 402, 405
LMAO THEY'RE LITERALLY JUST COPY PASTING FEATURES FROM .NET NOW
The absolute madman.jpg
.Net has had value types for ages, and C# added pattern matching ala JEP 405 a couple of years back! One thing I have to wonder about java primitives is whether they'll be remotely compatible with generics, I suspect not, in which case enjoy rewriting every algorithm for specific primitive types!
TFW you are in the shadow of your Microshaft clone, desperately trying to keep up
TFW java :story:
 
  • Autistic
  • Agree
Reactions: glow and Shoggoth
And let me try to clarify the whole Node/npm thing. Node.js is a server-side runtime environment, just like Ruby, Python, Perl, etc. npm is the package manager shipped with Node. The packages hosted on npm can be either node.js packages meant to be run in node.js, or client-side packages meant to be run in a browser, or environment-agnostic packages that have no dependencies on either environment. So normally in a client-side dev environment you'll have node.js and npm installed and you'll have a package.json file in your project that defines both your dev dependencies (build tools, linting, etc.) and your project's client-side dependencies (React, etc.)
That clarifies things a lot. Thanks. So, I want to use npm to vendor dependence for my project.
 
Back