Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
In my experience, it is much easier to read, write and understand a bunch of pure data transformers with some I/O shims on top than a big state machine where half the state is implicit.
Also known as functional core, imperative shell.

Curl got 200 from the endpoint for the most common use case, didn't shit the bed, sounds legit.
Congrats, you got a status code of 200 for the 404 page.
A type system that bakes failure into its model is instantly way more productive of a language.
Any language that doesn't have disjointed (sum) types is a lobotomized one.
 
Last edited:
So am I to infer that if I want a typed Lisp, I should move in the Racket direction? Are any of you Lispy nerds privy to other neat type systems for Schemes and/or Lisps?

Any language that doesn't have disjointed (sum) types is a lobotomized one.
The set of such languages is what, Haskell? Rust?
 
Is there a certain point where I have to worry about organization? It is my first time programming in the Go Programming language (or any lower level than JavaScript) and the import function confuses me as it does not appear to import scripts.
1769745836319.png
I believe I am at that point where an LLM can no longer help me other than menial tasks. I tried working on this on a branch but I have fucked up the organization.
Also I have this hosted on GitGud, do what you will with that. My current issue is that I fucking detest the CLI for being weird and not test friendly.
 
Is there a certain point where I have to worry about organization? It is my first time programming in the Go Programming language (or any lower level than JavaScript) and the import function confuses me as it does not appear to import scripts.
View attachment 8493119
I believe I am at that point where an LLM can no longer help me other than menial tasks. I tried working on this on a branch but I have fucked up the organization.
Also I have this hosted on GitGud, do what you will with that. My current issue is that I fucking detest the CLI for being weird and not test friendly.
The way that Go’s build system works, all files that are contained within the same directory are considered to be part of the same module, they are all compiled together, placed into the same executable/library, and any function or variable defined in any of them is available in all the others. If you want to break out code into seperate modules, you have to place them into seperate directories. This is generally not necessary unless you’re wanting to modularize certain parts of your code, or you’re working on something truly large.
Just breaking things out into different files is generally good enough organization. If I plan to reuse some component of my code across a handful of different projects, I’ll break it out into a module. Otherwise, it’s better to just keep everything together, I’ve learned.
Importing things is also done at the module level, not at the individual file level. So if you have some module, it’s really a collection of source files that have been compiled into a single unit, and it can be treated as a single unit.
 
Is there actually no way for a website tab to check how much memory it's currently using via any in-page accessible API? I've spent the last few days searching because it just popped into my head and there's nothing. Only very experimental, Chrome-exclusive shit. It cannot be this over, can it?
 
Is there actually no way for a website tab to check how much memory it's currently using via any in-page accessible API? I've spent the last few days searching because it just popped into my head and there's nothing. Only very experimental, Chrome-exclusive shit. It cannot be this over, can it?
Thank god there isn't, imagine the telemetry. What hellish use case do you have in mind for this?
 
Thank god there isn't, imagine the telemetry. What hellish use case do you have in mind for this?
There's better ways to profile than approximating how many megabytes of memory your webshit is eating at the moment I think. No particular use case, simply wondered how hard it is to check that outside of monitoring things manually in dev tools.
 
There's better ways to profile than approximating how many megabytes of memory your webshit is eating at the moment I think.
Fingerprinting is a combination of all the identifying information that can be pulled from the user's client. Walled gardeners would be willing to send a hitman directly to your house to kill you right this minute, if that's what it took to enable them to extract previously unavailable information, e.g. current memory usage, from a user's javascript sandbox.
 
This is my attempt at adding to the lisp discussion. Have some legacy code from the jak and dexter games.
Code:
(defun return-from-thread-dead ()
  "Like return from thread, but we clean up our process with deactivate first.
  The return register is not preserved here, instead we return the value of deactivate"
  (declare (asm-func none)
           ;(print-asm)
           )
  (rlet ((pp :reg r13 :type process)
         (sp :reg rsp :type uint)
         (off :reg r15 :type uint)
         (s0 :reg rbx :type uint)
         (s1 :reg rbp :type uint)
         (s2 :reg r10 :type uint)
         (s3 :reg r11 :type uint)
         (s4 :reg r12 :type uint))
    ;; first call the deactivate method.
    (deactivate pp)
    ;; get the kernel stack pointer as a GOAL pointer
    (.load-sym :sext #f sp *kernel-sp*)
    ;; convert it back to a real pointer
    (.add sp off)
    ;; restore saved registers...
    ;; without coloring system because this is "cheating".
    (.pop :color #f s4)
    (.pop :color #f s3)
    (.pop :color #f s2)
    (.pop :color #f s1)
    (.pop :color #f s0)
    ;; return to the kernel function that called the user code
    (.ret)))
 
The way that Go’s build system works, all files that are contained within the same directory are considered to be part of the same module, they are all compiled together, placed into the same executable/library, and any function or variable defined in any of them is available in all the others. If you want to break out code into seperate modules, you have to place them into seperate directories. This is generally not necessary unless you’re wanting to modularize certain parts of your code, or you’re working on something truly large.
I just wanted to know how to run `go run` instead of `go build` as it takes a lot of my valuable time. I forgot the period at the end as I was running a single file instead of the directory `go run .`. I tried asking a chatbot but it wants me to organize my code into a certain way so that is why I asked. If this thing I am working on does get big then I guess I will have to eventually organize.

I want to look into SHA256 file storage, I read about from osu! and I think it is best for storing media files that I will be exporting. For now I will be downloading them to a single folder.
I also want to look into server to client solutions as the database will be hosted on a server where multiple clients will be scrapping from multiple different servers they are in.

Then again both of those things are a bit more wishful, I will have to focus on establishing a good enough build to work with for now.
 
I just wanted to know how to run `go run` instead of `go build` as it takes a lot of my valuable time. I forgot the period at the end as I was running a single file instead of the directory `go run .`. I tried asking a chatbot but it wants me to organize my code into a certain way so that is why I asked. If this thing I am working on does get big then I guess I will have to eventually organize.

I want to look into SHA256 file storage, I read about from osu! and I think it is best for storing media files that I will be exporting. For now I will be downloading them to a single folder.
I also want to look into server to client solutions as the database will be hosted on a server where multiple clients will be scrapping from multiple different servers they are in.

Then again both of those things are a bit more wishful, I will have to focus on establishing a good enough build to work with for now.
if you are willing to dig through cancer ipfs stored data files in a hashed format.
 
if you are willing to dig through cancer ipfs stored data files in a hashed format.
sorry what? Can you clarify a bit?

Edit: nvm figured out what you were saying. That sounds a bit too complicated for my needs. I do not think I need a peer-to-peer hash table, that already sounds like a headache. then again I do need files saved.
 
Last edited:
Is there a certain point where I have to worry about organization? It is my first time programming in the Go Programming language (or any lower level than JavaScript) and the import function confuses me as it does not appear to import scripts.
View attachment 8493119
I believe I am at that point where an LLM can no longer help me other than menial tasks. I tried working on this on a branch but I have fucked up the organization.
Also I have this hosted on GitGud, do what you will with that. My current issue is that I fucking detest the CLI for being weird and not test friendly.
Fortunately, there's a great resource for this: https://go.dev/doc/modules/layout

You can move .go files into folders for sorting without problem, since imports and modules depend more on the package declaration at the top of your .go files.

Always organize well from the start; don't create work for your future self with all the inevitable refactoring. It's not a coincidence that people keep discovering that modular, interoperable setups are the best and most effective.

And not to shill, but you can always see how I do shit with my projects: https://github.com/y-a-t-s (gitgud mirror). Each library is basically its own module that you could put in a subdirectory in your project.
 
Last edited:
Back
Top Bottom