[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/prog/ - Programming

Programming

Catalog  Archive

Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Options

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


File: 1452304624517.jpg (43.29 KB,526x526,1:1,kista.jpg)

6e4d85 No.3830 [Open thread]

i need some serious help. i was in court today and the prosecutor asked the secretary if it was possible to run the vin and see when that vehicle had insurance and when it was canceled and so on. she said no. got me thinking if i can write a code and bring it maybe i can get off. what language would be best for this do you guys think. basically i need the prog to have a search bar to put in the vin. then i need it to search the databases of the insurance companies (with permission of course) just wondering what language and where i should start. writing the code or getting permission. i think i should write the code show it to them then they can get the companies databases since they wouldnt want to give it to a criminal. please help. here is a pic of my baby shaking her bones to trey and the gd at fare thee well gd50

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6e4d85 No.3835

>(with permission of course)

You won't get direct access to the database, ever. Even if you have a court order for something from the database, they won't give you access, they will instead search the database themselves and then give you only the data that was specifically ordered. Don't even write a single line of code until they give you an account on a database server.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6e4d85 No.3848

This thread is retarded. Insurance company databases don't just sort of have public interfaces you can plug into to pull arbitrary information about arbitrary VINs. You would have to either contact the company and have them give you the information or get the info off their website customer portal.

Furthermore, if there was a standard public interfaces for this, there would already be 50 different programs to pull the information.

It's pretty telling that you only describe the search function as "have a search bar". You either have no idea how to program or just know minimal bits of web design.

This is " code a GUI in Visual Basic to trace the killer's IP" level of retarded.

tl;dr: not only is it not possible, you also have no idea what you're talking about in the first place.

Your baby is a hippy retard and you probably are too, fuck back off to Reddit r/reiki/ or whatever stupid fucking spirit science board you come from.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1450844390813.jpg (38.85 KB,475x740,95:148,lfd.jpg)

8298ef No.3752 [Open thread]

Hello /prog/,

I would like to start off this new year by committing to learning at least 1 new, major library or SDK. Why only 1 library for the year? This way we don't end up hopping from library to library without gaining any real skill. This way we get to master it.

I suggest these:

>Android (make mobile apps, make money!)

>OpenCL (accelerate your computation, put that graphics card to better use!)

>Qt (gui's and so much more!)

>SQLite (master your data!)

Alternatively, it would also be very useful for any anons looking for a job to master machine learning techniques. I was thinking of working through pic related for starters. Would any anons be interested in learning neural nets / svm's / relevant tools, techniques, and libraries instead?

Who else would be interested in this? Are there any very useful, very practical libraries you would recommend beyond those listed?

After we settle on a library / learning we work through it for the year, post code, results, ideas, advice, explanations, and keep each other motivated.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3776

how about

>have an actual goal

>learn what you need in order to achieve that goal

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3780

>>3752

I've just started learning Android development.

I'm stating off with the free Udacity course. It's way slower than I'd like as it is designed for complete programming noobs, but it's material seems to be comprehensive, as I've had little problem following along and building the simple apps.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3786

>>3780

yes same here, just starting out but i've made some simple apps.

maybe we should make this an android app coding thread. and we try to make the most interesting apps and share them.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1451330733539.png (348.7 KB,540x396,15:11,12391045_847259475371410_1….png)

1a6620 No.3775 [Open thread]

I need help. I am working on a text editor for mobile and its a hybrid app, so its made with web technology. Everything is fine and all until I want to make a button that bolds future text, kind of like in Word. But I can only find one that makes everytext in the text area bold. This is not what I want. I cant find any help on how to do this in Javascript/Jquery on the internet.

This is what I have with jquery and jquery mobile:

$("#bold").on("tap",function(){

$(".editor").toggleClass("bold");

});

It makes every text in the editor bold. I want to make only future text bold.

Can someone help me?

Thank you

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3777

>text editor

>bold

well you're off to a bad start.

In order to do this, you can't have a single text area. when the user clicks bold you need to add a new DOM element with a bold style, and you need to handle mouse-clicks, arrow movement, selections, etc., to make your dense list of DOM elements function like a single area. it's a tremendous amount of work for literally no payoff: your users would be just as happy typing [b]blah[/b]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3778

>>3777

Ahh so what your saying is when a user clicks the bold button, I'll need to replace the text area in the background? That sounds like a lot of extra work but nothing too bad to be honest.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



9d5869 No.2970 [Open thread]

Bring all dirty, disgusting and generally cancer code here.

I start

http://pastebin.com/DYCcxWER

Because "Hello, World!" is too mainstream

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

9d5869 No.3769

>>2970

Got a laugh out of me

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



7b3b8e No.3760 [Open thread]

This seems to be the best board for this question, what are the most important Terminal commands to know? So far, I only know the following.


pwd
ls
cd
sudo -i
vi(m)
apt-get install
gcc -o file *.c

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

7b3b8e No.3761

grep

sed

find

awk

make

ed

man

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

7b3b8e No.3763

The most important terminal commands are

[code]\n

\r

\e[30m thru \e[37m

\e[40m thru \e[47m

\e[1m

\e[0m

\e[2J

\e[?25h and \e[?25l

\e[n;mH with n and m as coordinates

\e[s and \e[u

\e[n;mr with n and m as the top and bottom row[code]

That last one is pretty killer.

inb4 curses. You may as well use a fucking web browser.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



3dfbc1 No.3749 [Open thread]

Just started my first year in my computer science course at university, just wondering what the good books are to get a head start

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

3dfbc1 No.3759

File: 1450988845777.pdf (2.3 MB,sicp.pdf)

:^)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

3dfbc1 No.3785

>>3749

if you haven't read donald knuth's set yet you're pretty much fucked at this point tbh. good luck.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

20c593 No.5271

alacrity

fuckin shit

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1450783874042.jpg (52.76 KB,700x497,100:71,microsoft-office-2.jpg)

a1847a No.3750 [Open thread]

so, i was thinking about starting the development of a "normal" program, and i have honestly no idea how to that, since i never created something with a proper interface.

with "normal" i'm talking about a program meant to be used by not expert, with the standard stuff like automatic re size of windows and stuff like that. The office family is pretty much my idea.

are there some libraries that allow you to implement standard features like control+z?

do they have a simple graphic engine?

and how "normal" programs are even called?

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a1847a No.3751

You mean a GUI program?

It might be more complex than you think.

The big standard windowing and GUI APIs are Win32 for Windows, Cocoa for Mac OSX, and Xwin for Linux and BSD (though almost nobody uses Xwin raw).

If you want cross-platform, you should look into GTK or Qt, or even wxwidgets.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1450393789140.png (147.95 KB,1920x953,1920:953,aloonix.png)

41a193 No.3734 [Open thread]

Hi, for years, I've been writing most of my things in python, where it's completely unacceptable to be calling external commands, and been working on low level things with C and assembly, where I barely even need libc most of the time, so calling external commands in a program other than a shell script is very weird to me.

Now, after opening my eyes to (the awesomeness that is) lua, I'm wrapping a script around a tool written in shell (can't be written/it's very cumbersome to write in anything else, for a number of reasons). I'm also calling curl somewhere in the script. I do this because I've used libcurl in C before, and to me, the library doesn't seem to be made for using it to simply get a file, and instead, the command line interface is.

I'm aware that calling external commands breaks portability, but that is a non-issue in this case.

Now, I'm debating if I should either call find -type f or use LuaFileSystem to recursively iterate over every file in a directory.

I'd like to know: What is the most acceptable option, calling curl and find, or using their respective libraries? Also, is one of the options actually objectively better?

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

41a193 No.3740

Using the libraries and APIs is better unless you need the flexibility. Don't call an external program unless you need to. On top of the pain of fork and execing, it's also much more expensive and far less efficient.

Also, curl is just a thin wrapper around libcurl anyway.

It's hard to know what would be the proper way exactly without knowing your exact use case. The best option, though, is to either use libcurl and readdir/readdir_r for those two uses, or luacurl and luafilesystem, depending on which part of your program and how integrated you want that functionality to be.

You usually don't want to fork and exec unless you want to be able to invoke external functionality dynamically, such as having the user specify a command to use (like with a shell, or with any system that needs user plugins that should be language-agnostic, can work with program output, and don't need real IPC).

Don't call an external command unless you really need to and it fits your workflow. Doing an external call to something like curl or find is redundant, pointless, and prone to way more bugs. Not to mention that the overhead of managing the forked process as a child and making sure it exits properly and everything that goes with it is way more work than just using libcurl and readdir properly.

Here's the basic way with a fork:


int pipefd[2];
pipe(pipefd);

pid_t parent = getpid();
pid_t pid = fork();

if (pid == -1)
{
// Some error forking
return 1;
} else if (pid > 0)
{
// I am the parent
// Close writing end
close(pipefd[1]);

ssize_t newstart = 0;
char buffer[BUFSIZE];

while (true)
{
// Do the BUFSIZE - newstart - 2 for necessary injected characters, if needed
ssize_t size = read(pipefd[0], buffer + newstart, BUFSIZE - newstart - 2);

// This is done because the buffer was already offset. We want size
Post too long. Click here to view the full text.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

41a193 No.3741

It just occurred to me that you probably meant calling the script in Lua with pcall or something.

You can do that, but still keep in mind it will be far slower and more prone to bugs. You also have issues if you want to be able to get stdout, stderr, and exit status at once.

It is also worth mentioning that POSIX does have a simpler popen interface that wraps forking and execing. I haven't done POSIX C programming in a while.

Either way, native is always faster than forking. You fork and exec if you need the flexibility to decide certain things at runtime.

Now, practically, it will make little difference as long as find is there and the output is reliable. Objectively, forking is a worse option, but you won't notice a difference in runtime or anything unless you are doing some very heavy CPU-bound work.

I'd say to implement both ways and see what works best for you, if time isn't an issue.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

41a193 No.3744

>>3741

Yeah, I'm using system(3) and popen(3) from Lua depending on if I need to get the output.

I'm aware that calling the commands without the popen(3) interface from C is way more tedious, but that isn't the case from Lua, where it's two lines at best.

Thanks for providing your insight. You're right, using the libraries is the preferable way. There's just too many incompatibilities with implementations of commands, and sometimes the commands aren't even available and you just find out during runtime.

However, working in an environment I'm writing shell scripts for anyway (those are way more sensitive to the environment than Lua, and I'm using both curl and find in them) and not wanting to redistribute the lua script, I don't think it really matters in terms of being error-prone. In terms of being cpu-intensive… Again, script argument. Those call a command on nearly every operation. I think that's way more cpu-intensive. (and it doesn't really matter either, it's fast enough). So I can just use any method in this case, while still preferably the library method.

I just have to add one thing: It really depends on whatever you're doing if the readability increases or not (at least in lua). Doing "for file in io.popen("find"):lines()" is way less tedious than the example on the luafilesystem page to recursively iterate over a directory. Same thing goes for curl, really.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

41a193 No.3748

>>3744

That's a good point. In the end, whatever gets the job done and doesn't break is preferable if you can get it up and running.

The primary argument to library vs forking for me is flexibility. If you need to do something to files while iterating over them (such as taking a stat of each, or checking extended filesystem attributes), you can more easily do it with the library system.

If you're willing to handle the small performance hit of forking (and to be honest the performance impact of both filesystem access and network transmission are far higher) and you are sure the command syntaxes can be consistent, it's just up to personal preference.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1447702914061.jpg (19.88 KB,329x213,329:213,falsiness.jpg)

c3b352 No.3589 [Open thread]

What is something you hate about programming in general?

In other words, what programming features do you hate most that nearly every language incorporates?

Personally, I fucking loathe falsiness.

I hate it when any language inherently treats 0 as false, or empty strings, or empty lists, or NaN floating point values. It's excusable in C, and in C++ for C compatibility, but any language with a dynamic type system has no excuse.

The only things that should evaluate false are an actual boolean false value, or a null pointer (ie. pointer type with a null value, where type is significant, as integer 0 should still evaluate true).

5 posts omitted. Click [Open thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c3b352 No.3722

>>3589

>fucking hate falsiness

>null should be falsy

I hate gets() and scanf(). In CURRENT_YEAR, these libc functions should do nothing but cause a compile-time error, telling you to use shit that isn't fundamentally insecure (in the case of gets) or fundamentally incapable of interacting reasonably with a user (in the case of scanf). Read in lines at a time, into buffers that can contain those lines, and use sscanf() on read lines if you really want that shit.

I hate how every 'modern' 'advanced' 'high-level' programming language is stuck in the 90s. The Linux kernel continues to advance. It has all kinds of cool system calls. You can do shit like swap the names of two files without a race condition. But fuck it, Windows doesn't have that, and it wasn't portable among unices back in 1995.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c3b352 No.3723

oops that second one wasn't a future.

Replacement hate: laziness.

It is the solution for literally nothing, but it introduces all kinds of problems of its own.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c3b352 No.3726

>>3722

Null being falsy is unambiguous in almost every case.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c3b352 No.3728

>waah waah languages arent 100% theoretically correct

Fucking pretentious losers in this thread, what have you accomplished besides bitching?

https://en.wikipedia.org/wiki/Parkinson%27s_law_of_triviality

Go and write something more complex than "hello world" to have some weight behind your words before you act like a software god. Your code probably runs like shit, and that's not because gets() and scanf() suck, >>3722

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c3b352 No.3737

>>3728

I'm a professional programmer who has to use dozens of languages through work; you get a long list of things to hate when you have to use tons of different languages in codebases written by other people.

Why are you afraid that people might actually learn something and improve?

You can't really invoke Parkinson's Law of Triviality here, given that what we're talking about are basic programming features that affect every aspect of the language. That's the opposite of the Law of Triviality.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1450059581796.jpg (75.02 KB,850x400,17:8,CRYPTOGRAPHY.jpg)

4b8113 No.3714 [Open thread]

Get it now, a great wealth of a resource on Cryptography!

CRYPTOGRAPHY ARCHIVES.zip DOWNLOAD NOW!!

https://www.mediafire.com/?os3yc50tol5slzw

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4b8113 No.3725

File: 1450205967664.jpg (13.5 KB,320x180,16:9,Government Standardization….jpg)

CRYPTOGRAPHY ARCHIVES.pdf Full Set Combined into one pdf file 24336 pages

https://www.mediafire.com/?g9e0yolits9jeyo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1449126768299.png (35.59 KB,696x302,348:151,Folded-code_Python.png)

511cb2 No.3672 [Open thread]

So, whst do you guys do for some inspiration? I usually look at other peoples work or watch some tutorials. Pic related

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

511cb2 No.3674

I look in the mirror and realize I won't be getting laid without being successful.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

511cb2 No.3680

>>3674

i know that feel

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

511cb2 No.3681

>>3672

inspiration: noobody.org

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

511cb2 No.3682

Read about mathematical concepts, watch conference talks.

Occasionally a variation of this >>3674

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

511cb2 No.3704

I just have a vision in mind, and then go do it. I've never looked at anyone else's code. I've consistently ignored anything anyone says about "good" or "bad" languages, practices, anything. I just focus on my project, not worrying if I'm doing something in a "bad way" or any other distractions. That is all the "inspiration" I need.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



f16dfd No.3095 [Open thread]

So needed an algorithm to detect if 2 lines intersect

SAT doesnt work to well for lines, so i decided to see if i could figure out something myself

Remembered from Geometry class that if a quadrilateral is convex, then its diagonals must intersect, and if its concave, then they dont

So i thought: "if quad(line1point1,line2point1,line1point2,line2point2) is convex, then the lines intersect, otherwise no"

But then i thought: "but wouldnt the 'convex-test' algorithm itself need to test if the diagonals intersect?

Aka:

Line intersection algorithm needs a function to determine whether a quad is concave or not

Concave-test algorithm needs a line intersection algorithm to determine if the quads diagonals intersect

Its a paradox

CPU murdering recursion

Help me

2 posts omitted. Click [Open thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f16dfd No.3101

3d space or 2d space? Do you actually mean lines or line segments?

If 2d space, just check the slope. They intersect if they aren't parallel.

In 3d space, calculate their closest points. They intersect if their closest point is equal.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f16dfd No.3660

>>3095

something something vectors.

https://www.cs.utah.edu/~jsnider/SeniorProj/BSP1/default.html

has some code that might help you, such as methods that determine wether a point is in front of or behind a plane.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f16dfd No.3671

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f16dfd No.3685

Think of it like back in highschool algebra.

y=mx+b

if line 1 line 2

collision == true

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f16dfd No.3688

>>3685

what about vertical lines?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1420363460009.jpg (24.4 KB,364x455,4:5,poo.jpg)

df2de3 No.1029 [Open thread]

Objects are just lists.

How does that make you feel?
21 posts omitted. Click [Open thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

df2de3 No.1825

check out GObjects, the object implementation in GLib that GTK is built on.
(They use hashmaps though nuggah)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

df2de3 No.1827

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

df2de3 No.3650

it make a me feel gooot

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

df2de3 No.3651

File: 1448698302882.jpg (45.29 KB,330x357,110:119,Feelsgoodmangreen.jpg)

Objects are just instances of structs.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

df2de3 No.3656

>>3651

In C++, objects and structs are the same thing. struct and class are synonyms; it's valid C++ for a struct to have methods.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



8e6db6 No.3639 [Open thread]

What's the most basic instruction set a machine must implement in order to solve problems that isn't as impractical as a Turing machine?

I am not talking about real world implementations of simple CPU. I mean something more abstract, since CPU tend to use registers for performance purposes when all you actually need is a way to access stored variables, independently of how you do it.

With "most basic", I mean the bare minimum to run. You will need an add operator and a bitwise negation operator, but there is no need for a sub operation since a + !b = (a - b).

What's the actual bare minimum a virtual machine would need to be operable? I have been searching for a Turing completeness article that goes straight to the point, but they often end up saying "just implement a Turing machine".

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8e6db6 No.3641

>>3639

There's a decent amount of research into that, the minimum required for turing completeness. Also a common theme in esolangs. Binary combinatory is pretty fuggin simple, le copy-paste from http://esolangs.org/wiki/Binary_combinatory_logic

Binary combinatory logic

Binary combinatory logic (BCL) is a complete formulation of combinatory logic (CL) using only the symbols 0 and 1, together with two term-rewriting rules. BCL has applications in the theory of program-size complexity (Kolmogorov complexity).

Contents

Definition

Syntax

<term> ::= 00 | 01 | 1 <term> <term>

Semantics

Rewriting rules for subterms of a given term (parsing from the left):

1100xy → x

11101xyz → 11xz1yz

where x, y, and z are arbitrary terms.

(Note, for example, that because parsing is from the left, 10000 is not a subterm of 11010000.)

The terms 00 and 01 correspond, respectively, to the K and S basis combinators of CL, and the "prefix 1" acts as a left parenthesis (which is sufficient for disambiguation in a CL expression).

There are four equivalent formulations of BCL, depending on the manner of encoding the triplet (left-parenthesis, K, S). These are (1, 00, 01) (as above), (1, 01, 00), (0, 10, 11), and (0, 11, 10).

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8e6db6 No.3644

>>3639

This isn't exactly what you're asking, but I prefer lambda calculus to a turing machine.

https://en.wikipedia.org/wiki/Lambda_calculus

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



Delete Post [ ]
[]
[1] [2] [3] [4] [5] [6] [7] [8]Next | Catalog | Nerve Center | Random
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]