-
4 votes
-
The moral implications of being a moderately successful computer scientist and a woman
27 votes -
The zombie misconception of theoretical computer science
6 votes -
When provided with CVE descriptions of 15 different vulnerabilities and a set of tools useful for exploitation, GPT-4 was capable of autonomously exploiting 13 of which, yielding an 87% success rate
17 votes -
How to build an origami computer
7 votes -
Computer science pioneer Niklaus Wirth dies aged 89
20 votes -
Forth: The programming language that writes itself
10 votes -
On being a c̵o̵m̵p̵u̵t̵e̵r̵ ̵s̵c̵i̵e̵n̵t̵i̵s̵t̵ human being in the time of collapse
12 votes -
Do C programmers usually create and curate a personal library for their own use?
I've been using mostly C at my current job for about half a year now, and I find myself reusing some little function that I've written for another code base in current projects. I'm relatively new...
I've been using mostly C at my current job for about half a year now, and I find myself reusing some little function that I've written for another code base in current projects. I'm relatively new to this, so I'm wondering if it makes sense to have a repertoire of general purpose utility functions and whatnot for future use.
I mean, the language's pretty established and whatever I think of must have been written by somebody else already, so is there even a need for what I'm talking about? Are there well-known open source libraries that resemble what I am talking about? Should I just include them instead of writing my own?
Sorry if this is a bit vague. General purpose as in string manipulation, debug output, buffer operations, implementations of data types not in C, etc., just to name a few examples.
32 votes -
Numerically Stable RWKV Language Model
11 votes -
Dijkstra’s In Disguise [2018]
9 votes -
They're rebuilding the Death Star of complexity
16 votes -
You should be reading academic computer science papers
10 votes -
"SHA-1 is a Shambles" - A demonstration of a chosen-prefix collision for SHA-1 (2020)
5 votes -
Geospatial DuckDB
4 votes -
Faster PostgreSQL To BigQuery Transfers
2 votes -
Apollo guidance computer explained: Everything you need to know
3 votes -
Harvard CS50 – Full Computer Science University course
5 votes -
Faster hash table probing
4 votes -
The Law of Leaky Abstractions
4 votes -
Time till open source alternative
6 votes -
Awesome Isochrones
6 votes -
eCharts for Python
3 votes -
Python data visualisation
6 votes -
Hardening SSH
4 votes -
Pretty Maps in Python
6 votes -
Making Heatmaps
5 votes -
Why store code as text files?
Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this...
Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this is that formatting of the code can introduce changesbto the files that make no semantic difference, e.g. newlines are added/removed, indentation is altered etc.
Consistent formatting makes the code easier to read, but the style used is an aesthetic preference. There might be objective reasons for readability in at least the extreme cases, but in many cases the formatting is purely a preferred style.
If we instead version controlled code in the form of an abstract syntax tree (AST) (possibly even as just a series of transformations on that tree), we could have any formatting we'd like! When editing the code we would just be changing a projection of the AST and when we've made our changes the transformations could be made to the stored AST. If two languages shared the same AST the choice of language even becomes a choice for the programmer. Sadly this has some limitations since ASTs are usually language specific... But we could possibly take this a step further.
Could we take a compiled binary and use that as the basis for generating an AST? This is essentially what decompilers do. For heavily optimized code this is severely limited, but for debug builds a lot of extra information is retained in the binary that can be utilized to construct a sensible representation. This way of storing code the language used becomes a style preference! Code compiled from one language might become alien when viewed in another language (thinking of lazy Haskell code viewed in C), but maybe that is a corner case?
There are issues when considering binaries for different platforms. A binary for the JVM isn't the same as one for ARM64 or one compiled to run on an x86. So there are some limitations there...
One (very) good thing about storing code as text files is the ubiquity of software capable of viewing and editing text. It would however be cool if we could make programming language a stylistic preference that is compatible with other languages! At least the AST part should be perfectly achievable.
16 votes -
Making bracket pair colorization 10k times faster in VSCode
7 votes -
Rocket: A Web Framework for Rust
9 votes -
Google’s new ‘time crystals’ could be a breakthrough for long-awaited quantum computers
12 votes -
Multimodal Neurons in Artificial Neural Networks
3 votes -
A page containing videos/lectures for an entire computer science degree
7 votes -
Architecture for untrained software engineers (Python)
Hey everyone, I've been programming for some time now but notice without any formalized education in CS I often get lost in the weeds when it comes to developing larger applications. I'm familiar...
Hey everyone,
I've been programming for some time now but notice without any formalized education in CS I often get lost in the weeds when it comes to developing larger applications. I'm familiar with the principles of TDD and SOLID - which have helped with maintainability - however still feel that I'm lacking in the ability to architect a properly structured system. As an example, I'm currently developing a flask REST API for a website (just for learning purposes). This involves parsing a html response and serializing the result as JSON. I'm still quite unclear as to structuring this sort of thing. If any more experienced developers could point me in the right direction/offer up their opinion I'd be very appreciative. Currently I have something like this (based - I hope correctly? - on uncle bob's clean architecture).
Firstly, I'm defining the domain model. i.e the structure of the API response. Then, from outside in.
- Infrastructure (Flask): User makes request via interface (in my case a request to some endpoint)
- Adapters: request object checks if the request is valid (on the way back it checks if the response is valid) - Is this layer only for error handling?
- Repository: I'm struggling a bit here, AFAIUI this layer is traditionally a database. In my case however, where the request is valid, is this where I should handle the networking layer? i.e all the requests to return the website source? I'm also confused given at this stage I should be returning the relevant domain model, like an ORM, but as my data is unstructured, in order to do this I need to transform the response first. Where would it be best to handle this?
- Use Cases: Here I transform the domain model depending on the request. For example, filter all objects by id. Have I understood this correctly?
- Serializers: Encode the domain model as JSON to return from flask route.
If you got this far, thanks so much for reading. I really hope to hear the opinions of more experienced devs who can steer me in the right direction/correct me should I have misunderstood anything.
8 votes -
Are There Problems That Computers Can't Solve?
10 votes -
Analyzing the simplest C++ program
12 votes -
Open Mainframe Project helps fill the need for COBOL resources
7 votes -
The most surprising Unix programs
15 votes -
A persistent problem: managing pointers in Non-Volatile Memory
4 votes -
Is programming science?
There's no doubt computer science is indeed a science, but what about programming itself? Does it fulfill the basic requirements that make something a science? I'm not an academic, just trying to...
There's no doubt computer science is indeed a science, but what about programming itself? Does it fulfill the basic requirements that make something a science? I'm not an academic, just trying to start a conversation.
In many ways, programming is like Math: a means to an end. And Math is a science. Like math, programming has several fields with vastly different ideas of what constitutes programming. Because it is applied logic, programming is also provable and disprovable. There are many disputing hypothesis and, even though absolute truth is a distant dream, it is certain that some sentences are truer than others. Again, like Math, Programming has many practical applications, such as finances and engineering.
Some people consider Math a propaedeutics: not a science in itself, but a discipline that provides fundamentals to actual sciences such as chemistry and physics. The same reasoning could be applied to programming, as nothing more than a tool for computer science. I personally think there's something unique about programming and it's problem-solving methods that can be considered a field of its own.
What you guys and girls think?
6 votes -
The Two Generals’ Problem
7 votes -
Let's build a browser engine in Rust! Part 1 of 7
16 votes -
Ogham, an old Irish script that required an exception to the modern rules - ᚛ᚈᚑᚋ ᚄᚉᚑᚈᚈ᚜ and ᚛ᚑᚌᚐᚋ᚜ | Tom Scott
20 votes -
Mystery Languages
3 votes -
Conway's Law and creating worlds that create worlds
13 votes