r/compsci Jun 16 '19

PSA: This is not r/Programming. Quick Clarification on the guidelines

643 Upvotes

As there's been recently quite the number of rule-breaking posts slipping by, I felt clarifying on a handful of key points would help out a bit (especially as most people use New.Reddit/Mobile, where the FAQ/sidebar isn't visible)

First thing is first, this is not a programming specific subreddit! If the post is a better fit for r/Programming or r/LearnProgramming, that's exactly where it's supposed to be posted in. Unless it involves some aspects of AI/CS, it's relatively better off somewhere else.

r/ProgrammerHumor: Have a meme or joke relating to CS/Programming that you'd like to share with others? Head over to r/ProgrammerHumor, please.

r/AskComputerScience: Have a genuine question in relation to CS that isn't directly asking for homework/assignment help nor someone to do it for you? Head over to r/AskComputerScience.

r/CsMajors: Have a question in relation to CS academia (such as "Should I take CS70 or CS61A?" "Should I go to X or X uni, which has a better CS program?"), head over to r/csMajors.

r/CsCareerQuestions: Have a question in regards to jobs/career in the CS job market? Head on over to to r/cscareerquestions. (or r/careerguidance if it's slightly too broad for it)

r/SuggestALaptop: Just getting into the field or starting uni and don't know what laptop you should buy for programming? Head over to r/SuggestALaptop

r/CompSci: Have a post that you'd like to share with the community and have a civil discussion that is in relation to the field of computer science (that doesn't break any of the rules), r/CompSci is the right place for you.

And finally, this community will not do your assignments for you. Asking questions directly relating to your homework or hell, copying and pasting the entire question into the post, will not be allowed.

I'll be working on the redesign since it's been relatively untouched, and that's what most of the traffic these days see. That's about it, if you have any questions, feel free to ask them here!


r/compsci 1h ago

In Memoriam: Richard E. Stearns (1936-2026)

Thumbnail cacm.acm.org
Upvotes

r/compsci 1h ago

Implementation of Google's MapReduce algorithm

Upvotes

Namaste! I'm interested in implementations of Google's MapReduce algorithm.

https://www.cs.princeton.edu/courses/archive/fall13/cos518/papers/mapreduce.pdf

Please let me know if you'd like to discuss this in more detail. Bahut-bahut dhanyavaad :).


r/compsci 4h ago

MEIN PRODUKT hat gerade die BGL-, HDFS- und RE3-TT-Benchmarks im Blindversuch bestanden [offline]

Thumbnail
0 Upvotes

r/compsci 19h ago

NAND to Tetris Course approach

3 Upvotes

I recently started NAND to Tetris Course because I wanted to understand low level better. I started Unit one yesterday where you build logic gates. I have only watched videos to 1.4 HDL and started doing exercises. As a programmer with no formal training it has been hard to wrap my head around NAND (im getting there). The thing is i have built every component so far from only NAND gates to make them more intuitive. It has been time consuming to figure out how to do it but i find it fun. Is this stupid approach or does it rly matter if i use only NAND or logic gates that i have already made for building more complex logic gates for future exercises? I have been taking notes from every gate that i have built so it would be easy to switch later if needed. This is my MUX notes that i made before building it with HDL.

EDIT.

I built every logic gate up to DMUX from NANDs and normally both. Process how to get to NAND gates always involved OR, AND and NOT gates anyway when using boolean algebra. I built all other logic gates too but ditched NANDs. Didnt rly feel like writing any extra repetitive lines when busses were introduced. I was fun at start when it was a challange but became easy very fast. I still have my notes from all the elementary logic gates if I ever need a refresher. One table for simplest implementation with fewest gates (I could find) and another where i transform that to NANDs.


r/compsci 19h ago

What is the best method to try and compress a string of integers/extremely low entropy binary stream?

Thumbnail
0 Upvotes

r/compsci 2d ago

Is Modern Algebra easier than Ordinary Differential Equations, from a CS perspective?

1 Upvotes

I just started Week 3 of my ODE course, and I feel that I’m having a hard time applying the formulas and different rules for derivatives and integrals (it’s been years since I’ve done Cal 1 and Cal 2, and all of the learning was done online because of Covid). I’m thinking about dropping the class before the Census date, which is at the end of the week. I took Linear Algebra last semester, and I felt that I had a good grasp of it that I was able to get a B on the class. For Computer Science students, is it better to go with ODE or with Modern Algebra? I want to know so that I can take Modern Algebra in the next semester because it is only offered in the Spring semesters. I only need to do either ODE or Modern Algebra in order to fulfill the requirements of a high level math course, and not both.


r/compsci 4d ago

Anyone know where I could find this vintage Motorola 68000 programmer's reference manual?

Post image
21 Upvotes

r/compsci 5d ago

How is program synthesis better than writing code?

0 Upvotes

the idea of program synthesis (like Rosetta) is to reduce a function into its constraints in a spec sheet, and generate the program from those constraints. for example, in order to write something like x = x squared, you would need to write a spec sheet along the lines of ∀x∈Z,f(x)=x2. i am considering building a program synthesizer, but I still haven’t figured out why exactly this representation is supposed to be easier than writing the code directly (they look equally complex)


r/compsci 5d ago

Either the BS in Comp Sci degree will dramatically change, or a new degree will arise to replace its relevance.

0 Upvotes

For context, I’m a dev with 15+ years of experience, started coding in my early teens, and have a total love for the act of programming. I miss how coding used to be, nothing about this post is an advocacy for if things should be this way. After mulling it over, it just seems like an inevitability.

Right now the field of software development is like Wiley Coyote, already off the cliff but still running because he hasn’t noticed.

There has become a massive disconnect between what people in the field of software development actually do at their jobs, and what they’re interviewed on and learn in college. It’s like someone in 2007 having mandatory classes in Fortran and having to prove their knowledge of punchcards during job interviews.

My job, and the job of so many other software developers, has become almost entirely just interacting with AI agents. Yet we have job applicants do leetcode problems and write code live for us during interviews when we haven’t written more than a handful of a lines of code ourselves in the past year. The same extends to what these applicants are learning in college.

Effectively, it seems to me that the curriculum we currently know as a BS in Computer Science will become as generally superfluous as a PhD in Computer Science. Not at all useless, far from it. But held by those who either have a specific passion for the field or are looking to go into small and highly specialized areas of the field, not by the broader population simply looking to find a job after graduating. And in its place, as the broadly achieved degree, will be something much more tailored to the average needs of employers.

Seems like just a matter of time, driven by economics. Most employers don’t need someone with the full expertise of a computer science degree. Why would they pay for it? The only reason they have that as a standard now is because they do need someone who isn’t an untrained vibecoder. But that leaves a gap in the middle. Someone who isn’t going to delete the company’s database, but not necessarily with experience in database structure and rollups and joins. Someone who can use git and GitHub and properly manage deployments, but not necessarily someone who has done pointer arithmetic and compiler design. Someone who can catch and well document issues, not necessarily someone familiar with big O notation. In broad practice, AI can write good database structure and queries, AI can handle writing and running software, AI can measure performance and find areas to increase efficiency.

“But AI still makes mistakes!” You say. And you’re right. But so do software developers, oftentimes more than AI. There are quite a lot of average and below average software developers out there. And big companies, especially those dealing with higher risk/importance systems, will still have full computer scientists, experts in being able to know better than AI and review its work. But that won’t be most roles. That big company will still need someone to update and add features to the website. And someone to add features to the in house analytics tools. And someone to take user bug reports and get them fixed. And countless other roles that are simply an added layer in the corporate structure for the purpose of interpretation, oversight, and execution for AI. And that’s what the degree would teach towards.

I’d compare it to how nurse practitioners are taking on a larger role in the medical field, doing duties traditionally done by doctors such as diagnosing and prescribing. Effectively, the expertise of a doctor isn’t needed for average/mundane medical work, so a field rose in prevalence to fill that role, with a doctor’s expertise brought in when needed.

So it seems obvious to me that, perhaps within the next 5-10 years, a new degree will become the standard that teaches to that average need in the new state of the field.

That, or in 10 years AI tech accelerates to the point of computer science irrelevance. AI can do it so well and so entirely that non-tech people can just bark orders at it that would have been given to developers or their managers in the past. The degree diminishes and goes into the west.

Anyone see the same thing or am I off base here? Every counter argument I considered just sounded like some form of coping.


r/compsci 7d ago

CP/M Neo is a CP/M-inspired operating system for learning computer architecture and OS design.

Post image
23 Upvotes

r/compsci 6d ago

Self-taught from a languages and linguistics background: building a self-hosting compiler taught me what "complete" really means

0 Upvotes

I studied languages, linguistics, and literature — no formal CS.

I got into the field through curiosity about how languages work, human and formal alike, and ended up chasing that all the way down to building a self-hosting compiler.

The bootstrap was the moment it clicked: you compile the new compiler with an old one, then use the result to compile its own source, and when successive generations are byte-for-byte identical, you've reached a fixed point.

It's not just a milestone, it's a verification — the language has to be real enough to express its own implementation, with nowhere to hide inconsistencies.

Alongside that: a bytecode VM, a distributed key-value store, a synthesizer in pure assembly, and a data science degree.

Everything's public on my GitHub: https://github.com/whispem

Happy to discuss theory or the self-taught route.


r/compsci 9d ago

What garbage collection actually costs

Thumbnail shivanshuag.com
0 Upvotes

r/compsci 13d ago

Difference Between Data Model and Schema

7 Upvotes

From this: https://stackoverflow.com/questions/25093452/difference-between-data-model-and-database-schema-in-dbms, data model seems to be an abstraction for data and schema seems to be a blueprint.

This page lists various database models like relational, flat and network. So far good.

The book I'm reading (Fundamentals of Database Systems 7e, ch 3, pg 61) says

Once the requirements have been collected and analyzed, the next step is to create a conceptual schema for the database, using a high-level conceptual data model.

But this wikipedia page seems to imply that both a model and a schema are the same.

A conceptual schema or conceptual data model

Why is there so much discrepancy in defining a data model and a schema.


r/compsci 14d ago

[Request] What is the complexity in solving a grid-based least optimal path puzzle?

Post image
4 Upvotes

r/compsci 14d ago

WAL based distributed consensus on S3

Thumbnail github.com
3 Upvotes

r/compsci 15d ago

my attempt at anonymizing transitions in homomorphic encryption applied to turing machines. grade it from C for effort to A.

0 Upvotes

is it a terrible practice considering only absurd amounts of resource usage or is it generally a bad practice and why?

naturally you could find edge cases in camouflaging the turing machine between the others where its obvious that it is the original turing machine but is it generally impossible or merely resource intensive?

```tex

\documentclass[11pt]{article}

\usepackage[margin=1in]{geometry}

\usepackage{amsmath, amssymb, amsthm}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage{lmodern}

\usepackage{hyperref}

\title{Decoy-Fused Encrypted Turing Machine:\\

Anonymity via Homomorphic Decoy Placement}

\author{Anonymous}

\date{}

\begin{document}

\maketitle

\section*{Informal Motivation}

Hello reddit, I was bored so I was working on a decentralized anonymous encrypted cloud computing protocol.

Homomorphic encryption encrypts the data, but not the computation, gates, or transitional data of the Turing machine itself. The idea here is to introduce anonymity through decoy placement: instead of a single Turing machine being evaluated homomorphically, we fuse multiple machines together and hide the ``real'' one among decoys.

The core questions are:

\begin{itemize}

\item Can we make the real computation blend in with decoy computations so that it is not distinguishable?

\item Is this achievable under realistic homomorphic encryption models?

\item How can we avoid needing an astronomically large number of Turing machines to reach acceptable anonymity?

\end{itemize}

\section{Formal Setup}

Let $\mathcal{M} = (M_1, \dots, M_k)$ be $k$ Turing machines fused into a single composite, evaluated homomorphically for a fixed step bound $T$.

\begin{itemize}

\item $\pi \in S_k$ is a secret permutation encoding the role assignment.

\item $\rho : [k] \to \{\mathsf{real}, \mathsf{decoy}, \mathsf{cloak}\}$ is the role map.

\end{itemize}

We use a universal step function $\mathsf{UTM}_T$ unrolled to depth $T$. The composite circuit is

\begin{equation}

C_{\mathcal{M},T}

:=

\bigoplus_{i=1}^{k} \mathsf{UTM}_T(M_{\pi(i)}),

\end{equation}

where $\bigoplus$ denotes fusion into a single evaluated circuit.

The client receives a step-history of the whole computation and then isolates the real computation by selecting the correct step trace corresponding to $\rho^{-1}(\mathsf{real})$.

\section{Structural-Uniformity Precondition}

Let $\mathsf{shape}(\cdot)$ return the observable circuit profile (gate count, multiplicative depth, wire topology, bootstrap cadence). We require:

\begin{equation}

\forall\, i,j \in [k]: \quad

\mathsf{shape}\big(\mathsf{UTM}_T(M_i)\big)

=

\mathsf{shape}\big(\mathsf{UTM}_T(M_j)\big).

\end{equation}

If this condition fails, the adversary can trivially identify outliers and the advantage becomes $1$, i.e., the construction provides no anonymity. The shape is a strict property of the circuit encoding, not of the machines' internal logic.

\section{Security vs.\ Circuit Privacy}

Given structural uniformity, consider any PPT adversary $\mathcal{A}$ observing the composite circuit and evaluated ciphertexts. Its advantage in identifying the real machine is bounded by:

\begin{equation}

\Pr\big[\mathcal{A} \to \rho^{-1}(\mathsf{real})\big]

\le

\frac{1}{k} + \mathsf{negl}(\lambda),

\end{equation}

where $\lambda$ is the security parameter.

This is \emph{not} full cryptographic circuit privacy, which requires a simulator $\mathsf{Sim}$ over the entire circuit class $\mathcal{C}$:

\begin{equation}

\big\{\mathsf{Eval}(C, \mathsf{Enc}(x))\big\}_{C \in \mathcal{C}}

\approx_c

\big\{\mathsf{Sim}(1^\lambda, C(x))\big\}.

\end{equation}

Instead, we obtain $k$-candidate ambiguity over the chosen subset

\begin{equation}

\mathcal{C}_{\mathcal{M}} = \{M_1, \dots, M_k\} \subsetneq \mathcal{C}.

\end{equation}

In the limit as $k \to |\mathcal{C}_T|$, decoy fusion and circuit privacy converge:

\begin{equation}

\lim_{k \to |\mathcal{C}_T|} \mathsf{Adv}^{\mathsf{role}}_{\mathcal{A}}

=

\mathsf{negl}(\lambda).

\end{equation}

\section{Tuning the $k$ Parameter and Complexity Invariant}

Assume a BinFHE-style model, with $g$ gates per component and $t_{\mathsf{boot}}$ time per bootstrap. The execution runtime scales as:

\begin{equation}

\mathsf{Complexity}(k)

=

k \cdot g \cdot T \cdot t_{\mathsf{boot}}.

\end{equation}

Since the anonymity advantage is

\begin{equation}

\mathsf{Adv}(k) = \frac{1}{k},

\end{equation}

the product of security advantage and execution complexity remains invariant:

\begin{equation}

\mathsf{Adv}(k) \cdot \mathsf{Complexity}(k)

=

g \cdot T \cdot t_{\mathsf{boot}}

=

\text{const}.

\end{equation}

Thus, ambiguity scales linearly with computational overhead: $k$ acts as a tunable privacy/performance parameter. Larger $k$ yields stronger anonymity at the cost of higher homomorphic evaluation complexity.

\section{Open Questions}

This raises several technical questions:

\begin{enumerate}

\item \textbf{Gradient cloaking:} Can the ``gradient'' between the real Turing machine and the decoys (in terms of noise growth, bootstrap pattern, and intermediate ciphertext distribution) be made indistinguishable under realistic FHE schemes?

\item \textbf{Feasibility:} Is such decoy-based anonymity achievable without violating correctness or noise bounds in practical homomorphic encryption?

\item \textbf{Efficiency:} How can we avoid requiring extremely large $k$ (e.g., trillions of machines) to reach acceptable anonymity, while still maintaining indistinguishability among tracks?

\end{enumerate}

These questions sit at the intersection of circuit privacy, cover computation, and decoy-based anonymity in encrypted cloud execution.

\end{document}

```


r/compsci 17d ago

Does reversible computing require an enormous amount of storage?

9 Upvotes

First of all, I would like to say that I have no knowledge about computer science.

I recently heard about something called reversible computing. As I understand it, in ordinary computers, erasing information about the intermediate steps of a computation causes energy to be released as heat. But in reversible computing, the information from all the intermediate steps is preserved, so apparently, if we could build a computer capable of doing this, it could theoretically perform computations with essentially no energy consumption.
This made me wonder about something, and I’d love to hear from anyone knowledgeable about physics or computational theory:
If you never erase the information generated during a computation, wouldn’t the amount of storage required keep increasing as the computer performs more and more calculations?
I previously came across a science-related page online that said that an intelligent civilization that has mastered reversible computing wouldn’t need “Dyson’s eternal intelligence” to survive the heat death of the universe.
But wouldn’t such a civilization still need an absolutely enormous amount of storage to preserve all the information generated during its computations?
Or is there some way to preserve the information from the computational process without actually requiring additional physical storage?
I’m especially curious about how this works in the context of extremely long-term civilizations trying to survive the heat death of the universe.

By the way, this sentence was translated from Japanese to English by Chat GPT. Feel free to answer in English. However, I only understand Japanese, so I would really appreciate clear and simple English that is less likely to be mistranslated. Thank you!


r/compsci 18d ago

Any books similar to SICP Chapter 5?

Thumbnail
6 Upvotes

r/compsci 19d ago

AI watermarking makes a lot more sense for text than it does for code

Post image
55 Upvotes

I came across this explanation of AI watermarking and the part about code caught my attention.

Watermarking works better when there are multiple ways to say the same thing. But code is different. If a model needs to output something exact, changing the next token isn't always an option without potentially breaking the code.

There are still places where a watermark could be added, like comments or other non-essential text, but it seems much harder to watermark the actual code without affecting what it does.

I hadn't really thought about the difference between watermarking AI-generated text and AI-generated code before.

Do you think AI-generated code should be watermarked, or is it better to leave code alone?


r/compsci 19d ago

How Is Compression Prediction?

Thumbnail lukefleed.xyz
0 Upvotes

r/compsci 20d ago

what is the alternative to object-orientation?

90 Upvotes

A long time ago I went to school for computer science and I remember a big push towards functional programming at the time. I saw a little bit of Scheme and logic programming and I thought it was neat. I can appreciate those different ways of writing code, but I'm still not sure how any of those other styles actually replace object-orientation. I've started to look at Scheme again and I'm noticing that textbooks and libraries will actually build an object-oriented system on top of Scheme using macros. That has pedagogical value, but it seems like we're back at square one?

If you look at chapter 2 in SICP, one of the topics they cover is message passing. They don't use an explicit object-oriented system. Instead, they have an inner dispatch function that operates on local/private data. That seems like the behavior that classes are trying to model in other languages.

Getting to the point... my feeling is this: bundling state and functions seems like a basic thing in programming. This behavior seems to emerge even in systems which don't explicitly call themselves object-oriented. So my question is this: is there a real alternative? Are there large software systems which don't recreate the behavior of classes?


r/compsci 20d ago

Two unrelated images ended up 4 bits apart in dHash space — how conservative should duplicate clustering be?

0 Upvotes

Two completely unrelated images ended up being treated as near-duplicates:

Image A: beach landscape photographed through a car window;

Image B: a lifted-up page of a document.

 The measurements are:

Metric Image pair Threshold Result
Aspect-ratio Δ 0.000865 ≤ 0.02 Pass
dHash distance 4 ≤ 8 pass
pHash distance 30 ≤ 10 fail
wHash distance 15 ≤ 10 fail
Color-hash distance 6 informational

The matcher accepted the pair because the aspect ratio was nearly identical and the dHash Hamming distance was only 4, significantly below the threshold of 8.

 

The other perceptual hashes strongly disagreed (pHash was 30 against a threshold of 10, and wHash was 15 against a threshold of 10) but were never consulted because the dHash test did not seem to present a borderline case and thus was accepted as proof.

 

Interestingly this isn't really a random dHash collision. Both images apparently collapsed into a highly similar low-frequency brightness-gradient pattern after compression and downsampling.

 

dHash is good at surviving compression, in particular because it ignores fine detail and records coarse local brightness directions. But that same usefulness can be a weakness that can make unrelated low-detail images collision-prone.

The more interesting problem in my case is what happens next. Hardening is especially important because the tool uses union-find to form duplicate clusters. A single false-positive pair can become a bridge that attaches an unrelated image to a whole valid duplicate component.

 

Instead of a binary True/False decision, the matcher now returns the full evidence: for each metric (aspect-ratio, dHash, pHash, wHash) delta versus limit and the optional SSIM score are returned, as is the decision and, when rejected, the rejection reason.

 

This fix itself isn't particularly sophisticated. What I found more interesting is the design question it raised. Should the acceptance threshold for a perceptual-similarity edge depend on what you're going to do with that edge?

 

For image retrieval, a false positive may just mean one irrelevant result. For union-find clustering, a false-positive edge can change an entire connected component.

 

I'm curious how others approach this. Would you put most of the conservatism in the pair matcher itself, or enforce stronger intra-cluster consistency after constructing candidate relationships?

 

And for near-duplicate images specifically: would you prefer multiple perceptual hashes, SSIM/local features, embeddings, hierarchical clustering, or another approach?


r/compsci 21d ago

NP-hard is overrated

Thumbnail gruhn.me
0 Upvotes

r/compsci 21d ago

Compile C# in the browser

Post image
0 Upvotes

I made a browser playground for creative coding with C#, using a p5.js-style API.

No setup. Just code and run ... compilation of C# code happens in the browser.

Can be used for teaching / exploring C#.

https://csharp.codeguppy.com/

Feedback welcome!