There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

ericbomb , in This one goes out to the sysadmins in the crowd.

narrows eyes

Look I don’t “think” that was me this last few weeks. I’m pretty sure my support engineer butt was smart enough to check resources before blaming RAM…

But it totally could have been me, and in that case I blame dev.

NovaPrime , in I know, I know, but this revision compiles
@NovaPrime@lemmy.ml avatar

Docs? Is that like a new ChatGPT feature or something?

newIdentity ,

It actually kinda is. GPT-4 has an enormous token size so you can upload the whole documentation of a framework or program and ask it specific questions to it

philm ,

Has it though?

AFAIK it has like 4k tokens which roughly translate to 3k words or something like that.

The API has 8k or even 32k (this model should be interesting for something like that, unfortunately still don’t have access to it…)

So the docs have to be rather short, that it gets all the relevant stuff, or am I missing something?

sheogorath ,

GitHub Copilot just got an update increasing the token to 8k so I think it can be queried to help you with something similar. I haven’t had the chance to test it further after the new update.

doom_and_gloom , in Its not wrong though
@doom_and_gloom@lemmy.ml avatar

OS - obfuscated source

Kolanaki , in Its not wrong though
@Kolanaki@yiffit.net avatar

I’ve wondered: Can you go deeper than assembly and code in straight binary, or does it even really matter because you’d be writing the assembly in binary anyway or what? In probably a less stupid way of putting it: Can you go deeper than assembly in terms of talking to the hardware and possibly just flip the transistors manually?

Even simpler: How do you one up someone who codes in assembly? Can you?

mrpants ,

Re: Coding in binary. It makes no difference. Your assembly is binary, just represented in a more human readable form when writing it in assembly.

Re: Manual interaction. Sure there’s plenty of old computers where you can flip switches to input instructions or manipulate registers (memory on the cpu). But this is not much different from using assembly instructions except you’re doing it live.

You can also create purpose built processors which might be what you mean? Generally this isn’t too useful but sometimes it is. FPGAs are an example of doing this type of thing but using software to do the programming of the processor.

Kolanaki ,
@Kolanaki@yiffit.net avatar

this isn’t too useful

The point isn’t to be good, practical or useful. It’s to be cool 😎

But this silly question still informed me of something I had misunderstood: I had thought assembly and machine code were the same thing.

cacheson ,
@cacheson@kbin.social avatar

Perhaps you'd like to build an 8-bit computer?

PipedLinkBot ,

Here is an alternative Piped link(s): piped.video/watch?v=HyznrdDSSGM&

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

CaptainBuckleroy ,

Yes, you can code in machine code. I did it as part of my CS Degree. In our textbook was the manual for the particular ARM processor we coded for, that had every processor-specific command. We did that for a few of the early projects in the course, then moved onto Assembly, then C.

thepianistfroggollum ,

That was a fun class. One of the last ones I took before recursion made me change majors.

jdaxe ,

Hand writing machine code and assembly was fine, but recursion is where you draw the line??

thepianistfroggollum ,

My brain just can’t write recursive code. I can read it, but not write it.

doggle ,

Assembly effectively is coding in binary. Been a long time since I’ve looked at it, but you’d basically just be recreating the basic assembly commands anyway.

I guess you could try flipping individual transistors with a magnet or an electron gun or something if you really want to make things difficult.

If you actually want to one-up assembly coders, then you can try designing your own processor on breadboard and writing your own machine code. Not a lot of easy ways to get into that, but there’s a couple of turbo dorks on YouTube. Or you could just try reading the RISC-V specification.

But even then, you’re following in someone else’s tracks. I’ve never seen someone try silicon micro-lithography in the home lab, so there’s an idea. Or you could always try to beat the big corps to the punch on quantum computing.

ylph ,

The first computer I used was a PDP-8 clone, which was a very primitive machine by today’s standards - it only had 4k words of RAM (hand-made magnetic core memory !) - you could actually do simple programming tasks (such as short sequences of code to load software from paper tape) by entering machine code directly into memory by flipping mechanical switches on the front panel of the machine for individual bits (for data and memory addresses)

You could also write assembly code on paper, and then convert it into machine code by hand, and manually punch the resulting code sequence onto paper tape to then load into the machine (we had a manual paper punching device for this purpose)

Even with only 4k words of RAM, there were actually multiple assemblers and even compilers and interpreters available for the PDP-8 (FOCAL, FORTRAN, PASCAL, BASIC) - we only had a teletype interface (that printed output on paper), no monitor/terminal, so editing code on the machine itself was challenging, although there was a line editor which you could use, generally to enter programs you wrote on paper beforehand.

Writing assembly code is not actually the same as writing straight machine code - assemblers actually do provide a very useful layer of abstraction, such as function calls, symbolic addressing, variables, etc. - instead of having to always specify memory locations, you could use names to refer to jump points/loops, variables, functions, etc. - the assembler would then convert those into specific addresses as needed, so a small change of code or data structures wouldn’t require huge manual process of recalculating all the memory locations as a result, it’s all done automatically by the assembler.

So yeah, writing assembly code is still a lot easier than writing direct machine code - even when assembling by hand, you would generally start with assembly code, and just do the extra work that an assembler would do, but by hand.

Lowered_lifted ,
@Lowered_lifted@lemmy.world avatar

You could like make a simple accumulator machine out of logic gates and enter binary instructions expressed in hexadecimal into its register to program it, yeah, but it’s not capable of all the operations of a computer. But yes the first programming was just op codes, switches flipped or punch cards, there was no assembly language. But assembly language is pretty much just mnemonics for operations and registers. Like I had to write a couple C programs in school and use GNU C compiler to disassemble them into x86 assembly and see what it was doing on that level, then we “wrote” some x86 assembly by copypasting a lot of instructions but its not that hard to make something that works in like x86 assembly or like Jasmin (Java virtual machine assembly language) if it’s simple enough.

gerryflap ,
@gerryflap@feddit.nl avatar

You can code in binary, but the only thing you’d be doing is frustrating yourself. We did it in the first week of computer science at the university. Assembly is basically just a human readable form of those instructions. Instead of some opcode in binary you can at least write “add”, which makes it easier to see what’s going on. The binary machine code is not some totally other language than what is written in the assembly code, so writing in binary doesn’t really provide any more control or benefit as far as I’m aware.

jadero ,

All those assembly language instructions are just mnemonics for the actual opcodes. IIRC, on the 6502 processor family, JSR (Jump to SubRoutine) was hex 20, decimal 32. So going deeper would be really limited to not having access to the various amenities provided by assembler software and writing the memory directly. For example:

I started programming using a VIC-20. It came with BASIC, but you could have larger programs if you used assembly. I couldn’t afford the assembler cartridge, so I POKED the decimal values of everything directly to memory. I ended up memorizing some of the more common opcodes. (I don’t know why I was working in decimal instead of hex. Maybe the text representation was, on average, smaller because there was no need of a hex symbol. Whatever, it doesn’t matter…)

VIC-BASIC had direct memory access via PEEK (retrieve value) and POKE (set value). It also had READ and DATA statements. READ retrieved values from the comma-delimited list of values following the DATA statement (usually just a big blob of values as the last line of your program).

I would write my program as a long comma-delimited list of decimal values in a DATA statement, READ and POKE those values in a loop, then execute the resulting program. For small programs, I just saved everything as that BASIC program. For larger programs, I wrote those decimal values to tape, then read them into memory. That let me do a kind of modular programming by loading common functions from tape instead of retyping them.

I was in the process of writing my own assembler so that I could use the mnemonics directly when I got my Apple //c. More memory and the availability of quite a few high level languages derailed me and I haven’t touched assembly since.

collegefurtrader ,

Assembly is binary

steltek , in single binary executable and dlls

No one seems to mention license considerations when talking about static linking. Even if your app is open source, your particular license may not be legally compatible with the GPL, for example. 3BSD, MIT, and Apache most likely don’t change in a single binary but it’s kind of a new thing that no one was really thinking of before when mixing licenses together.

I think this default okay assumption comes from most developers having a cloud-centric view where there’s technically no “distribution” to trigger copyright.

TechieDamien ,

Even in the cloud you need to consider licenses such as the AGPL. Personally I don’t get this almost apathetic approach many developers have towards licensing and abiding by licenses.

nixfreak , in single binary executable and dlls

Cause statically linked libs can be very large. I agree though , rather have statically linked then dynamic.

muleunchangedstarved OP , in using gpu with linux experience

Ok I did it! opencl works and computer has gui. nice and updated

Steeve , in Just a Normal Sprint Planning -_-

Let’s also have you do a master rank codewars kata… on the whiteboard. You have 30 minutes.

Tedesche , in Oh yay new features

I don’t know why I find this so funny, but I’m keeping it.

Kalkaline , in “Hire me”
@Kalkaline@programming.dev avatar

I just looked at the W3schools page for React, fuck all that noise

Templa ,

I wish I could ban W3Schools and Geeksforgeeks from any search result

Kalkaline ,
@Kalkaline@programming.dev avatar

Geeksforgeeks, I agree because of the paywall. I’m a beginner and I guess I don’t see the problem with W3Schools yet. What are better resources beyond the official documentation?

Templa , (edited )

I always use MDN if I need to check anything JS related. For React, I don’t see why use anything else other than the official documentation. If you’re learning I’d suggest Full Stack Open or even Odin Project which are courses that at least bother to explain a little of best practices.

DNAmaster10 ,

Generally I’m not against w3 schools for quickly checking the syntax of something or how to use a specific method, but I always try stay clear of their larger code examples.

I was learning PHP a couple years back for some hobby side projects I was working on. They provide some code here about how to connect to an SQL database. I ended up using this code for almost a year on some publicly hosted sites.

The code they provided isn’t secure, though. It can output database errors to the client, and give away information about your database which a random user shouldn’t have access to.

Additionally, the beginning few pages for their SQL insertion examples doesn’t mention anywhere that you should be using prepared statements. There is a page slightly further down, but for the average person learning the language, there’s no reason for them not to just copy parts the extremely insecure code and use it in their projects.

W3 schools imo is great for quickly checking up on something, but generally it’s probably better to avoid their examples and look up the language standards somewhere else.

CCatMan , in Error 502:

They need a gateway computer in there.

cloudy1999 , in Recursion

If we keep doubling, will I eventually be a person on the tracks? There are a finite number of people, so eventually I would be, right? So, passing the buck would be equivalent to handing my fate to a stranger.

OTOH, if there are an infinite number of people, then this thought experiment is creating people out of thin air. Do these imaginary people’s rhetorical lives even matter?

Either way, it seems better to kill 1 person at the start.

ActuallyRuben ,

If it creates infinite number of people, it could solve world hunger with some good ol’ Soylent green thinking. Although you might want to figure out how to slow down the trolley at some point.

QueenOfSquiggles , in CoPilot is muslim
@QueenOfSquiggles@lemmy.blahaj.zone avatar

I feel so accomplished in my studies that I can recognize a React component now! (Here’s to hoping I can finish my full stack certification soon lol)

iminahurry , in Int and bool walk into a bar

Instructions

while temperature < comfortable_temperature: temperature += 1

Interpretation

while temperature < freezing: on toggle(temperature += boiling)

WtfEvenIsExistence , in I know 69 languages

You know 69 “Programming Languages”

I know 69 Real Languages

We are not the same

/s

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines