/dpt/ - Daily Programming Thread

Colton Barnes
Colton Barnes

What are you working on Sup Forums?
previously supforums.com/thread/65289456/technology

Attached: *ports-C99*.png (531 KB, 1107x1077)

All urls found in this thread:

supforums.com/thread/65289456/technology
desuarchive.org/wsr/thread/483076/
lkml.org/lkml/2018/3/20/845
en.wikipedia.org/wiki/Cartesian_product
docs.python.org/3.8/library/itertools.html#itertools.product
en.cppreference.com/w/cpp/language/value_category
open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
pastebin.com/tBcrUWNv
github.com/Chlumsky/msdfgen
stackoverflow.com/questions/6180012/array-with-size-0
blog.rust-lang.org/2018/03/29/Rust-1.25.html
pcwalton.github.io/2017/02/14/pathfinder.html
developer.ibm.com/javasdk/downloads/sdk8/
random.org/integers/?num=1&min=0&max=9001&col=1&base=10&format=html&rnd=new
supforums.com/thread/65302096/technology

Liam Torres
Liam Torres

Wow a new thread!

Mason Scott
Mason Scott

Yea amazing right?

Zachary Jones
Zachary Jones

Taking an intro to OS class and I need to implement my own fixed point arithmetic for priority scheduling, I'm a C pleb and general CS brainlet pls help

Elijah Moore
Elijah Moore

tfw failed my first CS mid term

What the fuck nothing on the review and homework was on the exam! Time to switch to web development

Attached: sad-bod.jpg (27 KB, 406x451)

Liam King
Liam King

neat
pls help
well, what did you try already?

Juan Collins
Juan Collins

syllabus?

Eli Kelly
Eli Kelly

supforums.com/thread/65289456/technology
Cobol and Java do not compete in the same market, bro. Nice try though.

Levi Miller
Levi Miller

Julia GPU programming master race reporting in.

Attached: julia.jpg (3.45 MB, 2560x1920)

Kayden Harris
Kayden Harris

I'm completely stuck, they gave us function stubs to work with and basically said have at it, I conceptually get what needs to happen but C is so difficult to decipher to me. Literally just anything to point me in the right direction would be great

Jonathan Davis
Jonathan Davis

I'm re-learning Java and C++. What IDE should I use? Used to use Eclipse but I really hated it, the fact you couldn't compile outside of the very specific workplace configuration used to be me insane. Suggestions?

Attached: 1522083145257.png (329 KB, 900x900)

Daniel Taylor
Daniel Taylor

post stubs

Thomas Nguyen
Thomas Nguyen

Reminder that lazy evaluation exists at the CPU level and imperative programming is a poor fit for low level programming.

Elijah Adams
Elijah Adams

Python cannot beat Perl because Perl is already popular.

Robert Roberts
Robert Roberts

Daily reminder that the meltdown patch was all about stamping it out.

Ethan Morgan
Ethan Morgan

back-compat dont real
SpaceBook cannay beat MyFace because MyFace is already poppler.

Kayden Hall
Kayden Hall

VS code and VS comunity

Tyler Taylor
Tyler Taylor

EEE and VendorLockIn
ftfy

Xavier Lewis
Xavier Lewis

Don't listen to the microshill. For Java get Intellij, C++, get QtCreator

Liam Martin
Liam Martin

C is so difficult to decipher to me
Then you lack the natural talent necessary to use a computer.

C is the most intuitive of all programming languages. It's pure computation expressed as text, putting abstract thought and raw hardware instructions in perfect harmony.
C is truth itself. How can truth be difficult to understand? Clearly, the problem is with you.

Owen Nguyen
Owen Nguyen

Is that meaningfully different from VS? The last time I downloaded VS it took like 30 gigs was unresponsive and never worked demanding constant updates that bloated it even further. I'm loath to try again...

Jackson Nelson
Jackson Nelson

don't believe 's meems
and be prepared for similar autismo-tardation in gee threads if you stick around

Michael Taylor
Michael Taylor

hm

Michael Rivera
Michael Rivera

Future Proof Code is Written in C

Leo Jackson
Leo Jackson

Meltdown is a bug, not a design flaw. Hence why it doesn't affect every CPU with out of order or speculative execution.

Samuel Robinson
Samuel Robinson

Sepples webdev :^)

Attached: Screen-Shot-2018-03-28-at-9.37.23-PM-edited.png (1.36 MB, 2880x1704)

Liam Torres
Liam Torres

c is weak type trash, rust is the future old man

Joseph Sanchez
Joseph Sanchez

CPU caching is just fancy memoization.

Ethan Reyes
Ethan Reyes

Currently working on a lexer. I have no idea what I'm doing nor am I sure what I'm actually writing a lexer. I'm sick of writing pajeet tier reader macros so I'm writing something that takes my own make believe psedu BNF grammar. At the end of this hopefully my reader macros will not be pajeet and only the underlying lexer.

Here's my current grammar for a string:

`((char #f (#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m
#\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z
#\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\0 #\- #\=
#\! #\@ #\# #\$ #\% #\^ #\& #\* #\( #\) #\_ #\+
#\[ #\] #\; #\' #\, #\. #\/
#\{ #\} #\| #\: #\< #\> #\?
#\space #\tab #\newline))
(any #f (char #\\ #\"))
(escaped #t #(#\\ any))
(string-meat #f (char escaped))
(string #t #(#\" * string-meat #\")))

Xavier Jones
Xavier Jones

How are you doing that struct initialisation?

When I do it, I can't do the .struct_member = 1 syntax because C++ doesn't that recent C language feature.

What version of C++ are you using?

Brayden Ramirez
Brayden Ramirez

webdev in C++

what's the point? are you masochist?
kek

Attached: ss.png (100 KB, 746x794)

Cooper Sanchez
Cooper Sanchez

I'm trying to record some data from a Unity project with a C# script and I want to serialize it with a timestamp. However, I get throwing DirectoryNotFound errors. It works as long as I don't try to do add anything dynamic like the timestamp. Any idea what the fuck is going on?

public class DataCollector : MonoBehaviour {
...
static string path;
static DateTime ts;
...

void Start () {
rb = player.GetComponent<Rigidbody> ();
ts = DateTime.Now;
path = String.Copy("Assets/Resources/test" + ts.ToString("yyyyMMddHHmmsszzz") + ".csv");
sw = new StreamWriter (path);
...
}

Adam Hall
Adam Hall

Does it handle Chinese characters?

Anthony Stewart
Anthony Stewart

Well it handles them the same way it handles a missing ". Returns Nothing.

Jace Myers
Jace Myers

what the fuck

Levi Bailey
Levi Bailey

Apparently it's supposed to be available in C++20, but Clang supports it for all C++ versions (with a warning about C99 if -Wpedantic is on). I don't know if GCC supports it, I don't have it installed.

what's the point?
To showcase modern C++ as a web-ready langauge (aka it soothes my autism)
that pic
man what ugly formatting and colors, who the fuck would do that :^)

Hunter Jackson
Hunter Jackson

fails on caps

Why are you not just using ascii codes and comparing bulk ranges?

Jack Collins
Jack Collins

I tried it in MSVC with C++14 and it politely told me to fuck off :(

Colton Sanders
Colton Sanders

be an absolute beginner and brainlet
bang out a solution to some chapter two exercise that's basically cash register software
works perfectly fine with some amounts, shits the bed with change for nickels and pennies with other amounts
this is due to actual fucking limitations of computers
What did I get myself into?

Attached: im-done.jpg (56 KB, 300x360)

Colton Martin
Colton Martin

expecting full c++ support on visual studio this century

memes aside vs2017 has pretty decent support for almost all language features (fuck having to even say that). If you don't hate yourself though just go get a windows compiled version of clang and use that to compile instead.

Xavier Diaz
Xavier Diaz

Part of why it looks weird is that I've been fucking around with making things static and nonstatic, and private in an attempt to see if that's causing the issue; none of that has had any effect.

Carson Martinez
Carson Martinez

using floats to store currency values
I hope you don't seriously do this

Christian King
Christian King

I'll keep this in mind, I intend to split a good portion of this code off into a reusable framework. As far as I'm concerned you shouldn't be running a production environment off anything but a Linux box (preferably CentOS) but that doesn't necessarily help people learn.

To be fair this is a C++20 feature, and iirc the C++20 feature set isn't finalized yet so there shouldn't be an expectation that compilers support it.

Noah Robinson
Noah Robinson

Funnily enought I'm using vs2017 because of the built-in cmake 3.9 support

Jordan Kelly
Jordan Kelly

FINE

(define (ascii-seq char n)
(map integer->char (iota n (char->integer char))))
`(alphanumeric #f (,@(ascii-seq #\A 26) ,@(ascii-seq #\a 26) ,@(ascii-seq #\0 10)))

Ryder Ortiz
Ryder Ortiz

Trying to solve project euler problems in asm.

Jose Hughes
Jose Hughes

B-but. the cents!

Gabriel Jenkins
Gabriel Jenkins

Plugging my question about something related to compilers:

desuarchive.org/wsr/thread/483076/

Anybody knows the name of the topic(s) I should look into?

Liam Garcia
Liam Garcia

You using floats or doubles for currencies?
Computer math 101: real numbers don't real

Adrian Young
Adrian Young

store it as an integer, multiple and divide by 100 to convert to and from stored to actual value. Or store it as a string and parse the strong.

Ian Ortiz
Ian Ortiz

I have no idea, but that looks like Prolog maths without any syntactic sugar

Jayden Kelly
Jayden Kelly

What you have there is just infix notation. No different from

(+ (+ (/ (* 8 y) (- 4 z)) 8)

if(x==1) {
x++; y++;
} else
++z;

might be represented as
(if (== x 1) (block (post++ x) (post++ y)) (pre++ z))

Anyway the magical word you're looking for is abstract syntax tree.

Kevin Robinson
Kevin Robinson

Chip 8 Emulator

Right now, I'm less focused on implementing the operation codes, and more on making sure I can render all the text/graphics correctly using SDL .

Anyone know why I'm getting "pixel hiccups" in the webm attached? (apologies in advance for shitting up the bitrate. I'm new to compressing videos to the 4MB limit). Like, why are a bunch of letters flashing ?
I have a "gfxToWindow" method to get an array and draw it to the screen, and I have a "WindowClear()" method that draws the bg.

Below is the code for both of them, and they're the only places where I change the renderer:

chip8::gfx_To_Window()
{
for(int row = 0; row < HEIGHT; row++)
{
for(int col = 0; col < WIDTH; col++)
{
if(gfx[col + row*WIDTH]) //current pixel is ON
//I call SDL_RenderDrawPoint on a bunch of points in this fn'
pxl_To_Window(col * SCALE , row*SCALE, SCALE);
}
----------------
void
Window::clear()
{
SDL_RenderPresent(_renderer);
SDL_SetRenderDrawColor(_renderer, 0, 0, 200, 255);
SDL_RenderClear(_renderer);
}

What am I doing wrong?

Attached: out3.webm (424 KB, 1280x1100)

Jose Nelson
Jose Nelson

$1.01*$1.01 = $102.01

I mean for addition/subtraction it works fine but it fails miserably on multiplication granted you just have to eugh calc the amount of numbers you're multiplying by and then do num_mults*decimal_constant

Jordan Cook
Jordan Cook

Branch & jump instructions.

Thomas Cruz
Thomas Cruz

No double buffering?

Joshua Walker
Joshua Walker

I'm having a really weird ass issue with C and SDL2 right now (also using Codeblocks and Windows 8.1).

So when I go to draw my level (tile based), it'll go through and draw any tile that could appear on screen. For some reason now, it won't draw the very first tile.

Here's the weirder thing though. If I make a random draw call before my for loop, then the first tile within the for loop will draw.

What I have learned from this is the first call to draw the tile doesn't do anything even though it says it does. I've even ran it through the debugger and I can't figure it out.

What can I do to fix this?

Gavin Rogers
Gavin Rogers

(101 / 100) + (101 / 100)
2.02

Robert Powell
Robert Powell

My car won't start, but when I push it down the hill it'll kinda roll, you know?

Nathan Anderson
Nathan Anderson

Float in Python

Brandon Butler
Brandon Butler

Maybe?

How do I check if I'm double-buffering and how do I prevent it?

Josiah Nelson
Josiah Nelson

Sounds like you've fixed it. I've had to a similar thing for ncurses. In my init code there is a

ungetch(1); getch():

Colton Hall
Colton Hall

/dpt/ how do I into building a desktop app that reads data from a .xls spreadsheet and spits out pretty graphics? javascript?
something like pic related

Attached: paymetric-dashboard3.jpg (103 KB, 800x600)

Daniel Bennett
Daniel Bennett

for addition it works fine
for multiplication it fucks up under immediate assumptions

that is what I wrote but paraphrased. Also you're wasting cycles.

(101+101)/100 is the same effect.
(101 * 101)/100 -> wrong answer of 102.01
instead you've got to do ..
((101 * 101)/100)/100 -> 1.0201 truncated to 1.02.

Henry Moore
Henry Moore

wpf

Hunter Rodriguez
Hunter Rodriguez

That's not an ideal fix though, this is something i'd like to fix.

Jeremiah Richardson
Jeremiah Richardson

a neural network library in C with Vulcan support.

Logan Cooper
Logan Cooper

right, I meant to do multiplication but had a brainfart

Evan Rodriguez
Evan Rodriguez

In your words, what do you call these things:

class {
private:
int year;
char *name;
...
}

I've never thought about what these variables should be called, and would just refer to them as maybe "local variables" or "class variables".
I damned near failed an exam about JS when they asked me to "iterate over the properties" because I didn't know what the fuck a "property" meant.

Cooper Jones
Cooper Jones

double buffer isn't something you can easily accidentally do. all that's different is you have 2 buffers for filling data for rendering. On one frame you're rendering from the [0] element on the next frame you're rendering on the [1] element. Meanwhile on the cpu/host side you're updating the opposite buffers (at least hopefully) It's done to reduce pipeline stalls. Most people do triple buffering now so there's additional head room incase either gpu or cpu is a bit slow and helps smooth our stalling.

Ayden Wood
Ayden Wood

it fails miserably on multiplication
You can multiply two 32-bit integers into a 64-bit integer with no loss of precision cheaply on x86 at least. Software can do it for any precision.

Gabriel Bailey
Gabriel Bailey

class members/member variables

Joseph Young
Joseph Young

with Vulcan support
I'd rather use even opengl compute shaders. But I'm pretty sure openmp has gpu acceleration.

Zachary Hernandez
Zachary Hernandez

an anonymous namespace is one that has no name and is only valid for the current translation unit in c/c++ so in that same vein I'd say anonymous class. If the members were public and there were no constructors I'd call it an anonymous pod(plain old data).

Leo Clark
Leo Clark

how does wpf compare with a js library like pic related?

Attached: chartjs-tutsplus.jpg (8 KB, 400x277)

Kayden Davis
Kayden Davis

This. Similarly function in a class/struct are called member functions. "Methods" is gross Javaspeak.

Jose Watson
Jose Watson

Fields.

Brayden Adams
Brayden Adams

I'm a burger flipper who has been working on video games with a friend, I do all the programming and I refrain from using any libraries that do more then SDL
any chance that I can get a job in software or anything tech related or should I just kms because I hate flipping burgers

Jack Cooper
Jack Cooper

methods is gross javaspeak
You mean every programming language except for C++ speak. Dumb seppleslet.

Brandon Collins
Brandon Collins

methods
class functions
member functions
errr

I mean they're functions.... that are a member of a class really just a function pointer that requires and implicitly provides *this to the call stack what else are you supposed to call it?

Lincoln Hughes
Lincoln Hughes

methods are function pointers

Attached: 1521912231368.jpg (63 KB, 638x558)

Lincoln Ross
Lincoln Ross

whatever you choose, it'll need to be heavily sugar coated to look like that.

JavaFX is by far the easiest with FXML and CSS.

WPF and XAML can be as good but it's a nightmare to learn

Nathan Thomas
Nathan Thomas

QML

Henry Watson
Henry Watson

Most functions in C/C++ are memory addresses that are passed to the platform's equivalent of a CALL instruction. Sometimes those addresses are known at linking, sometimes only at runtime.

Andrew Foster
Andrew Foster

a method. c++ calls methods member functions because the committee thinks its fancy or something and want to be different.

conflating a language with its compiled form
There's nothing to stop you from interpreting C. It didn't stop Terry.

Tyler Rodriguez
Tyler Rodriguez

interpreting is just a run time compiling of the language. you still have some intermediary between the actual executed ops on the cpu. Any target is valid. and at some level its going to be a branch call on whatever architecture you're using. Typically that's going to be stored in the elf data or dll or exe or whatever the fuck your compile target is and it'll be loaded in to memory for the cpu to execute. Yes you can put other steps in between the end result but it boils down to the same thing.

So yes; methods (member functions) are just glorified function pointers. if it's non virtual it can be known at compile time and inserted directly at the call site otherwise its going to be a vtable look up.

Justin Martinez
Justin Martinez

conflating a language with its compiled form

void func(){}
??? f = func;

so what's the type of f?

Lincoln White
Lincoln White

alright thanks

literally who

Andrew Myers
Andrew Myers

What does this have to do with methods, exactly?

Daniel Perry
Daniel Perry

void func(){}
using func_type f = decltype(func);
//func_type -> void(&)()

Henry Harris
Henry Harris

By this logic, labels (for goto) are just glorified function pointers.

Jason Lopez
Jason Lopez

They literally are.

Owen Edwards
Owen Edwards

Do I have to mention that you have to set up the registers...? I mean what the fuck do you want, yes there's more compiler book keeping than whats mentioned but its not like its wrong either.

but goto is just another branch which means its just like a function
If you do the book keeping sure.

Jaxon Wright
Jaxon Wright

Are methods still function pointers if you "execute" code on paper?

James Clark
James Clark

What paradigm is a good fit for low level programming?

Brody Jones
Brody Jones

no. because its not code.
but paper is code hurr
no an execution of operations is code.
oh so assembly machines are code then
kys

Parker Hughes
Parker Hughes

So are jumps that are part of conditions or loops function pointers? You have to set up registers for the next iteration or correct branch.

Incoherent post.

Juan Cruz
Juan Cruz

No they're not the same; they both include jumps, but calls also require stack management. In fact on many architectures there's a separate assembly instructions for "call" & "return" vs. "jump" that automates the stack pushing & popping.

Colton Richardson
Colton Richardson

What if the method is inlined? Clearly it ceases to be a method because there is no call stack management and it is not a function pointer.

Wyatt Torres
Wyatt Torres

How long do you have to be a developer before you stop feeling like and being a brainlet?

Jason Hall
Jason Hall

labels can also be represented as continuations and goto as calling those continuations. Whatcha gettin at?

Functions aren't function pointers you baka. The referencing is implicit because the function is in an rvalue context.

Brayden Barnes
Brayden Barnes

Yeah that's why I was originally said "most functions" tee bee aich I'm mostly shitposting because I don't like brainlet wojacks

The referencing is implicit
you got me :^)

Attached: Screen-Shot-2018-03-28-at-11.26.14-PM.png (42 KB, 1342x78)

Luke Cooper
Luke Cooper

there is no additional bookkeeping done besides updating of a few control variables
does this mean that I can skip the bookkeeping required for maintaining stack state and call it a function call?
no. Stop being retarded.

what if its inlined
the compiler is still inserting this-> before every call to a object's local members.

desu whatever makes the most sense for the domain you're working with. If the intent is best expressed with OOP or OOD or functional or whatever just go with it and maintain some sanity in your calling styles and you're good.

forever. no really you'll invariably specialize in some specific field and start thinking
hey I know this. that means I can understand it easily, because I understand it easily that means everyone else also understands it because its easy. therefore what I've done is easy. all those things I haven't done and don't understand are hard therefore those people are smart and I'm dumb

Luis Price
Luis Price

Alright, you got me, I didn't see the "most".

Dylan Jackson
Dylan Jackson

Glad none of you fags are using my language. We don't need dead weight in our community.

Cameron Hall
Cameron Hall

Yeah, but how many years of programming until I actually stop being a brainlet, regardless of feeling like one?

Grayson Morris
Grayson Morris

yes. I'd like to think I'm not a brainlet because I've specialized into meta programming and am autistically developing my own game engine but I've "only" been doing that for 3 years. But I'm pretty sure I can at least language lawyer about the majority of semantics...

So based on my self perceived thing I'd say its more to do with how much you've done and how varied/specialized it is. If nothing else you're still programming there's tons of people that look at it like its gook runes.

Joseph Bennett
Joseph Bennett

The referencing is implicit
you got me :^)
try this on for size you brainlet

void benis() { }
int main() {
void (*foo)(void) = ******************benis;
}

As you can see, the referencing is implicitly happening because benis is in an rvalue context.

Nolan Turner
Nolan Turner

Declarative, of course, as the dual to imperative.

David Fisher
David Fisher

fug it works
On the language level isn't a function always evaluated to a pointer so dereferencing it will just return another pointer... so you can keep doing that indefinitely (or for comical effect)?

Nathaniel Thomas
Nathaniel Thomas

What if there were a 3D language that let you zoom in and out of layers of abstraction, all the way down to the assembly code

Kevin Lee
Kevin Lee

If a moron makes his own programming language, but no one is stupid enough to learn it, does it really exist?

John Martinez
John Martinez

It does if it compiles.

Are you high?

Lucas Hall
Lucas Hall

Yes

Joshua Phillips
Joshua Phillips

Does it?
If so, congrats! I kind of want to make my own lang one day, but don't really know where to start. Any pointers(heh)?

Michael Rogers
Michael Rogers

isn't a function always evaluated to a pointer
no

void func(){}

template< typename T > struct type_printer;

int main( int argc, char* argv[] )
{
auto f = func;

type_printer< decltype( func ) > printer;
type_printer< decltype( *************func ) > printer2;

return 0;
}

Eli Ortiz
Eli Ortiz

yes

Carter Bennett
Carter Bennett

I should be clearer. No, but the conversion is implicit, so for most practical purposes Yes.

Charles Adams
Charles Adams


Oh, I think it's guaranteed by the standard that 'sizeof()' doesn't
evaluate the argument value, only the type.

I'm in awe of your truly marvelously disgusting hack. That is truly a
work of art.

lkml.org/lkml/2018/3/20/845

Attached: 1521064423352.jpg (23 KB, 340x296)

Jaxon Myers
Jaxon Myers

void benis() { }
int main()
{
using anons_mess = decltype(*****************benis);
using anons_other_mess = decltype(benis);
}

both have the same type names
I mean theres probably some pedantry about it but meh

Charles Jenkins
Charles Jenkins

#define ICE_P(x) (sizeof(int) == sizeof(*(1 ? ((void*)((x) * 0l)) : (int*)1)))

The absolute state of C

Attached: 1519221407637.jpg (10 KB, 255x255)

Thomas Butler
Thomas Butler

Tue, 20 Mar 2018 16:08:30 -0700
its this year
Oh fuck I hoped the era of absolute cancer preprocessor code was slightly behind us

Brayden Johnson
Brayden Johnson

weak typing
There's your problem, which Rust or C++ doesn't have.

Nathan Ward
Nathan Ward

Relies on GNU (C) extension
lel clang cucks BTFO even further

Leo Phillips
Leo Phillips

The language is inserting the &'s for you. It inserts the *'s too if it's in an lvalue context.

#include <stdio.h>
void benis() { printf("benis\n"); }
int main() {
void (*foo)(void) = ****&*****&********&****&benis;
(******&**&*foo)();
foo();
}

Note that
&(&benis)
is a syntax error as is
(&foo)();

error: called object is not a function or function pointer (&foo)();
tells ya what the gcc nerds think about it.
they have the same types because the compiler is inserting the &'s for you.

Isaac Nelson
Isaac Nelson

They don't in the code I posted, so my "not always" statement still stands.

Luke Lopez
Luke Lopez

C11 coming thorugh

#include <stdio.h>

#define ICE_P(x) _Generic((1? (void *) ((x)*0) : (int *) 0), int*: 1, void*: 0)

int main(void) {
int x = 1;
printf("%d %d\n", ICE_P(1), ICE_P(x));
return 0;
} // compiled with GCC 6.3

Evan Clark
Evan Clark

I feel like such a brainlet here. Someone help me out please.

I'm trying to make a simple program in python that gives all possible sequence of answers for a quiz. There are 12 questions on the quiz, each one having a possible choice of either 'A', 'B', or 'C'

So one of the possible solutions would be:

AAAAAAAAAAAA

along with
CBACCCBAABCA

This is the code I came up with. The fucker is still running. My fucking brainlet mind could only come up with a solution with 12 for loops.

questionNums = 12
possibleAnswers = {0:'A', 1:'B', 2:'C'}

for a in range(3):
for b in range(3):
for c in range(3):
for d in range(3):
for e in range(3):
for f in range(3):
for g in range(3):
for h in range(3):
for i in range(3):
for j in range(3):
for k in range(3):
for l in range(3):
print (possibleAnswers[a] + possibleAnswers[b] + possibleAnswers[c] + possibleAnswers[d] + possibleAnswers[e] + possibleAnswers[f] + possibleAnswers[g] + possibleAnswers[h] + possibleAnswers[i] + possibleAnswers[j] + possibleAnswers[k] + possibleAnswers[l] + '\n')

Help

Attached: NHHNNN-MMMM.....png (34 KB, 817x443)

Cameron Bell
Cameron Bell

I don't get it. does C not have to concept of r/l values or int literal and variables?

Ryder Cruz
Ryder Cruz

This is a linear algebra problem. You are of retard.

Hunter Ward
Hunter Ward

No, he has to learn math. STOP

Nathan Moore
Nathan Moore

[''.join(q) for q in __import__('itertools').product('ABC', repeat=12)]

Jacob Lopez
Jacob Lopez

start with list variable containing a single empty answer. in a loop, make three copies of the list. append A to all of the first, B to all of the second, and C to all of the third. then append those three copies together. If you succeed, then congratulations you've used your first monad.

Nolan Jones
Nolan Jones

Attached: 1518199099507.jpg (46 KB, 480x472)

Jaxon Ortiz
Jaxon Ortiz

I'm never going to be as smart as this.

Hudson Hughes
Hudson Hughes

theres something in itertools or whatever that lets you permute things like that. Your code is on par with the new averaging system.

Robert Gutierrez
Robert Gutierrez

an rvalue is just whatever comes after the assignment operator e.g. = similarly with lvalue being on the left.

More specifically there are only certain semantics that are valid to use on each side. e.g. it makes no sense to do

 int 1 = c;

but it does make sense to do
int c = 1;

it works the same in both c and c++ so I'd assume the answer to the question is yes? but I don't think c programmers are as autistic about the usage/terminologies as most c++ users are. (re: move semantics aka type&&)

Kevin Thomas
Kevin Thomas

An r-value is a fitness percentage in a regression, you stupid nigger.

Dylan Cox
Dylan Cox

lol what the fuck am i looking at

Christopher Bennett
Christopher Bennett

Read on and stop being a brainlet:
en.wikipedia.org/wiki/Cartesian_product
docs.python.org/3.8/library/itertools.html#itertools.product

Jackson Murphy
Jackson Murphy

Why would you multiple one amount of money by another amount of money??????

Thomas Jackson
Thomas Jackson

en.cppreference.com/w/cpp/language/value_category

a fucking lot of terms are reused given the context I assumed what I assumed and you assumed something different.

Jayden Rogers
Jayden Rogers

hurr durr RTTI is baaad
#define ICE_P(x) (sizeof(int) == sizeof(*(1 ? ((void*)((x) * 0l)) : (int*)1))) is fine

Jose Phillips
Jose Phillips

He doesn't know about term overloading

Cooper Hernandez
Cooper Hernandez

I have an overload in my ballsack if you want to suck it out.

Austin Edwards
Austin Edwards

Attached: cs-grad-combination.png (102 KB, 1500x680)

William Williams
William Williams

int (*k)(), v;

what does this line do? Does it create a pointer to a function that returns an int (k) as well as an int v?

Dominic Flores
Dominic Flores

fuck c
f is a function pointer that's unassigned that returns an int
v is an int
magix

Parker Rogers
Parker Rogers

thats what I thought, ty

Jaxon Hernandez
Jaxon Hernandez

EXAMPLE 1
The declaration
int f(void), *fip(), (*pfi)();
declares a function f with no parameters returning an int,a function fip with no parameter specification returning a pointer to an int,and a pointer pfi to a function with no parameter specification returning an int. It is especially useful to compare the last two. The binding of *fip() is *(fip()),so that the declaration suggests, and the same construction in an expression requires, the calling of a function fip, and then using indirection through the pointer result to yield an int. In the declarator (*pfi)(), the extra parentheses are necessary to indicate that indirection through a pointer to a function yields a function designator, which is then used to call the function; it returns an int.
open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

Lucas Butler
Lucas Butler

yeah, k is a function pointer with 0 parameters that returns an int
int (*k)(void)

Elijah Perez
Elijah Perez

pastebin.com/tBcrUWNv

Is there a faster method?

Xavier Clark
Xavier Clark

what the fuck am i reading

Evan White
Evan White

at what point did you when writing this think "Theres gotta be a better way" and then said nah that's too difficult and proceeded to write that disaster?

Joshua Anderson
Joshua Anderson

Here's a little javascript solution I whipped up that solves for any string of possible answers and the number of questions. It's all about recursion.

function Combinations(characters, digits)
{
if(digits == 1) return characters.split("");

var subset = Combinations(characters, digits - 1);
var result = [];

for(var i = 0; i < subset.length; i++)
{
for(var j = 0; j < characters.length; j++)
{
result.push(characters[j] + subset[i]);
}
}

return result;
}

console.log(Combinations("ABC", 12));

Anthony Powell
Anthony Powell

This is bait, right?

Luis Lewis
Luis Lewis

What's the next pajeet certification I can get to rake in the big shekels?

Attached: oracle-certified-professional-java-se-8-programmer.png (24 KB, 352x352)

Benjamin Nguyen
Benjamin Nguyen

On the 30th else if statement. I understand it can be faster in certain cases. This one seems like it could done with a single function though. Or rather checking the size and then referring to a table/ db for what to do

Christopher Cooper
Christopher Cooper

22GB then 10-1000GB in increments of 10GB each

Really all that needs to be done is checking if the value is whole, and then evenly divisible by 10.

for bonus points
Make it a circle or some other cancerous input method that requires you to approximate the valid inputs and deny anything but an exactly perfect input

Thomas Jenkins
Thomas Jenkins

SDL2 does double buffering for you.
The issue is most likely he's updating the window between clearing and actual rendering, hence why he sees intermediate incomplete frames.

Aaron Hughes
Aaron Hughes

What are you working on Sup Forums?
Trying to get my text rendering to take less CPU. I am using the technique where you render each character individually using the same shader. From what I remember its supposed to run alright.

I have reduced the loop for rendering to what I have below but I am still seeing the CPU jump 10x higher than when I don't render text.

for char in text:
glUniform2iv(char_offset,1,char_offsets)
glDrawArrays(GL_TRIANGLES,0,6)

Attached: scrot.png (505 KB, 1920x1080)

Lucas Taylor
Lucas Taylor

for char in text:

I thought typically (especially so with text) you should attempt to maximally batch your rendering so as to reduce drawcalls (also especially so with older apis e.g. opengl/dx11 and earlier).
I'll have to implement this myself later anyway.
You should be able to store a single quad on the gpu, have a scaling matrix to adjust the height/width + position then pass a buffer of indexes that indicate what texture (that refers to an individual character) to use. As for how to do that on the shader side... I'm confused atm.

As for what happens at miplevels or rendering glyphs I haven't looked into it enough yet but I can give someone's github that's got a nice smooth text algo/rendering: github.com/Chlumsky/msdfgen

oh but rendering text is easy just type "hello world"
if only it were so simple...

Ethan Nelson
Ethan Nelson

I was one of the haskellfags that would solve leetcode problems a while back.

Decided to check on /dpt/ the last couple days and I haven't seen the familiar namefags like Ruby. Have I been awake at the wrong times or did they leave or what?

Landon Bennett
Landon Bennett

Why the fuck am I wasting time learning to program? I should crack open a math book what the hell am I doing?

This programming stuff is dumb bullshit only those with emotional problems could enjoy. I'm out.

William Cooper
William Cooper

of the autistic inclined things I could do I'd rather go for the even more pure form of autism, those that only enjoy the lesser autism must have emotional problems.
I guess enjoy going from vaguely applied math to pure math?

Chase Gray
Chase Gray

maths is more autism than this

Anthony Watson
Anthony Watson

What language should I make my simple sub-fetching program in?
It needs to be able to compile to native code

Charles Wilson
Charles Wilson

math is peak autism though

Brody Nelson
Brody Nelson

If I have a list that contains other lists and I delete the biggest "container" list, am I going to get a memory leak or is it going to delete the other lists in it as well?

Attached: question-13.jpg (44 KB, 640x480)

Thomas Jones
Thomas Jones

Hi guys, I'm working on a vector class, trying to dynamically grow an array in c++.

I had it compiling, but it wasn't working as the question in my tutorial says that the starting size of the array must be 0.

void Vec::push_back(const double& x)
{
int current_size = get_current_size();

//Check if array is full.
if (get_current_size() == get_limit()) { grow(); }

pointer_to_data[current_size] = x;
}

void Vec::grow()
{
//Allocate memory for array
if (get_current_size() == 0)
{
double* temp = new double[1]; //Allocate new memory
}
else if (get_current_size() == get_limit())
{
array_limit = get_limit()*2; //New size of array to be used.
double* temp = new double[array_limit]; //Allocate new memory
}

//Copy old values into new array.
for (int i = 0; i != get_current_size(); ++i) {
temp[i] = pointer_to_data[i];
}

delete[] pointer_to_data; //Clean memory.
pointer_to_data = temp; //Point at new data.
}

These are the offending functions, initally I didn't have the have the if, else if in grow to initialize memory as size 1 for the start case when array_limit is 0 and it compiled. But now that I am trying to make this grow to 1 when it is 0, I am getting out of scope. Anyone know how to do this?

Charles Ward
Charles Ward

g++ -c -g Vec.cc
Vec.cc: In member function \u2018void Vec::grow()\u2019:
Vec.cc:99:3: error: \u2018temp\u2019 was not declared in this scope
temp[i] = pointer_to_data[i];
^~~~
Vec.cc:99:3: note: suggested alternative: \u2018time\u2019
temp[i] = pointer_to_data[i];
^~~~
time
Vec.cc:103:20: error: \u2018temp\u2019 was not declared in this scope
pointer_to_data = temp; //Point at new data.
^~~~
Vec.cc:103:20: note: suggested alternative: \u2018time\u2019
pointer_to_data = temp; //Point at new data.
^~~~
time
make: *** [makefile:8: Vec.o] Error 1

Compilation errors.

Brandon Martinez
Brandon Martinez

If its a properly tested container anything the outermost layer container owns will be fully deleted.

e.g....

std::list<std::list<int>> why;

or your language equivalent*
any time an outer node is destroyed the owned list is also destroyed (along with whatever it also owns..)

If you're doing c++ make sure to use destructors and sanely handle pointers (just use smart pointers for your sanity).

<var> was not declared in this scope
That's due to you declaring it local to your if/else branches.

Alexander Wright
Alexander Wright

Nim

Jordan Garcia
Jordan Garcia

I just started learning go a few days ago. can anyone help with copying files between a tcp server/client.

Elijah Bennett
Elijah Bennett

Only if that means that you'll struggle to do async.

Matthew Howard
Matthew Howard

Thanks. The language I'm using is pretty obscure and it's high-level too.

Matthew Baker
Matthew Baker

Yep, I realized that after I posted it, I've fixed that, that was a silly oversight. But now I'm getting out of bounds. Segmentation fault (core dumped). And I don't understand why, when I return to push_back I then get the current size of the array and then try and allocate to the last element. Which now that I think about it won't work when I double the size of the array, however, I'm not even getting to that point. Can't allocate to even the first element.

void Vec::grow() 
{
//Allocate memory for array
if (get_current_size() == 0)
{
double* temp = new double[1]; //Allocate new memory
return;
}

else if (get_current_size() == get_limit())
{
array_limit = get_limit()*2; //New size of array to be used.
double* temp = new double[array_limit]; //Allocate new memory

//Copy old values into new array.
for (int i = 0; i != get_current_size(); ++i) {
temp[i] = pointer_to_data[i];
}

delete[] pointer_to_data; //Clean memory.
pointer_to_data = temp; //Point at new data.
}
}

Here is what I have now. I have tried putting print statements to find out when I'm going out of bounds but it crashes before it gets to any of them.

Luis Sanders
Luis Sanders

void Vec::push_back(const double& x)
{
//Check if array is full.
if (get_current_size() == get_limit()) { grow(); }

int current_size = get_current_size();
pointer_to_data[current_size-1] = x;
}

The function that calls it, thought I had that copied too. Both get_limit and get_current size should be returning 0 as thats what they are initialized as.

James Long
James Long

C programmers against OOP
use structs

the ultimate irony

Tyler Rivera
Tyler Rivera

pointer_to_data is initialized to nullptr yes?

get_limit returns 0
Er... new double[0] is illegal.

size_t array_limit = get_limits()*2;
//evaluates to
size_t array_limit = 0*2; //0
double* temp = new double[0]; //can't do

pods are not object oriented programming per-say. Usually it implies encapsulating methods inside of the class and handling management of the internal state of the class. Yes; its entirely possible to implement janky objects in C, I'd suggest not doing it though (e.g. virtual function table lookups and the like)

I've replied too much in this thread I'm getting ass cancer captchas.

Cooper Morris
Cooper Morris

I'd kill for an OOP language that has structs (not the sepples kind of struct)

Hudson Mitchell
Hudson Mitchell

stackoverflow.com/questions/6180012/array-with-size-0
bah so I'm correct in intent but wrong in pedantry. Regardless its bad to create a zero length array because what the fuck are you going to do with it anyway? it makes no sense to want one. Most likely the first issue that code would run into is dereferencing the the zero-length array. Really just a pointer that points to god knows where.

I just want a language that enforces pod only semantics but I don't want the language that's flexible enough to force those semantics

template<typename candidate_type, std::enable_if_t<std::is_pod<candidate_type>::value,bool> =true>
void some_func_that_loves_pod_only(candidate_type&& data) //takes pods only
{}
template<typename candidate_type, std::enable_if_t<!std::is_pod<candidate_type>::value,bool> =false>
void some_func_that_loves_pod_only(candidate_type&& data) //takes non pods
{}

but sepples structs are just classes that are marked public by default xddd
What are you wanting.. be specific about it and I'm sure you could meta up a check that enforces it.

Anthony Hernandez
Anthony Hernandez

java is unironically comfy

Carter Hill
Carter Hill

when you create a class, are you creating a type of the type class ?

William Reyes
William Reyes

come again?

Michael Lewis
Michael Lewis

space question mark

Andrew King
Andrew King

That would make sense with the 0 * 2.

But now I have

if (get_limit() == 0)
{
double* temp = new double[1]; //Allocate new memory
return;
}
else
{
array_limit = get_limit()*2; //New size of array to be used.
double* temp = new double[array_limit]; //Allocate new memory

//Copy old values into new array.
for (int i = 0; i != get_current_size(); ++i) {
temp[i] = pointer_to_data[i];
}

delete[] pointer_to_data; //Clean memory.
pointer_to_data = temp; //Point at new data.
}

If getlimit = 0, initialize as size 1, if not, initiliaze as getlimit*2...

I have a print statement, before my if in push back:

void Vec::push_back(const double& x)
{
cout << "limit: " << get_limit() << endl;
cout << "size: " << get_current_size() << endl;

//Check if array is full.
if (get_limit() == get_current_size()) { grow(); }

cout << "skipping if";
int current_size = get_current_size();
pointer_to_data[current_size-1] = x;
}

My output prints limit:, size:

Does not print "skipping if"

and my first line in grow() is cout << "entering grow" which does not print. I'm not touching an array or pointer between the if in push_back and I'm getting segment fault. I don't understand why.

pointer_to_data is initialized as 0 as per the tutorial specs.

Andrew Clark
Andrew Clark

do you not have a debugger of some kind? It'd be much easier to just set a breakpoint and step through the execution until you core dump/crash.

all this assisting the botnet due to attempting to chat with anons

Brody Brown
Brody Brown

I've found where it is going out of bounds but now I can't see why. The multiplication fixed my segment fault, but when I return to push_back and try to assign my parameter to pointer_to_data[0] or even pointer_to_data[get_current_size] it segment faults there. So I assume I'm not pointing temp to it correctly and it's somewhere in these two lines:

delete[] pointer_to_data; //Clean memory.
pointer_to_data = temp; //Point at new data.

Charles Martinez
Charles Martinez

finally going to lose my virginity next week
wish me std::luck, Sup Forums

Chase Gonzalez
Chase Gonzalez

just don't go needing a std::list

Benjamin Ross
Benjamin Ross

It is very tedious and things can get cumbersome very quickly. Also, you can't even have pointers or interoperate with C easily.

Thomas Howard
Thomas Howard

It is very tedious and things can get cumbersome very quickly
water you talking about??

Lucas Cox
Lucas Cox

pass a buffer of indexes that indicate what texture (that refers to an individual character) to use
I looked at a old directx11 font rendering shader that I thought I was remembering and I did this. Makes sense, the cpu is having to constantly interact with the gpu the way I am doing it now.

I just didn't like the idea of having to set a static size for the buffer. Realistically I will not hit the maximum chars but I'd rather have the ability to have a dynamic number of characters renderable.

Josiah Barnes
Josiah Barnes

Usually you build a mesh to upload all triangles in one go, not upload 2 triangles per character

But even if you do you should be able to upload about 100,000 characters per second at 0% cpu load

Landon Kelly
Landon Kelly

Nested imports
Finally

blog.rust-lang.org/2018/03/29/Rust-1.25.html

Jeremiah Robinson
Jeremiah Robinson

People whine at languages lacking pointers but I've never felt a situation where I needed pointers unless I'm doing a list from scratch as an exercise. What are the practical uses?

Attached: neet-question.png (260 KB, 620x640)

Liam Hall
Liam Hall

pcwalton.github.io/2017/02/14/pathfinder.html

Easton Murphy
Easton Murphy

just make a buffer that automatically resizes itself when it's too small

Nicholas Harris
Nicholas Harris

2018
not multi-channel signed distance fields

Jeremiah Walker
Jeremiah Walker

That looks fucking disgusting

Jordan Martin
Jordan Martin

Any library that needs to pass chunks of data around uses pointers

Adam White
Adam White

This is the first time I took a look at rust's syntax.
It is shit.

Jacob Wright
Jacob Wright

It's needed for interop between different languages because they all have their own array and object implementations that aren't compatible with each other
But pointers are universally understood

Joshua Flores
Joshua Flores

That link doesn't have so many of the examples of Rust's syntax but whatever you say.

Joseph Anderson
Joseph Anderson

The '::' and 'std' were enough.

Sebastian Barnes
Sebastian Barnes

:: is actually better than .
std means standard, nothing wrong with that as well.

Michael Miller
Michael Miller

::std::is_better::in_it::beg::<than_type>::this(.-kebab-DOT)
Sure thing kid. Does it use '->' (ur angus) for heap objects?

Elijah Davis
Elijah Davis

opinions challenged
get angry
Sup Forums is adorable.

Justin Jackson
Justin Jackson

adorable
How dare you?

Nicholas Ramirez
Nicholas Ramirez

Do you have to use special syntax or modules or anything? Pls post example.

Jonathan Green
Jonathan Green

being gay

Robert Collins
Robert Collins

Probably just a python midget, gets scared to see types.

Liam Gonzalez
Liam Gonzalez

Should I start writing my own toolkit to extend a programming language or start over?
Any guides on lexers and compilers? The current blueprint I have on this is thousands of string operations and branches.

Joshua Rogers
Joshua Rogers

He's not even trolling... Just imagine being this delusional and thinking the CPU instructions are "declerative".

Attached: autismo.gif (528 KB, 480x270)

Xavier Diaz
Xavier Diaz

1.01$ * 1.01$ = 1.02$2

Attached: 400.jpg (127 KB, 353x400)

Dominic Evans
Dominic Evans

Should I start writing my own toolkit to extend a programming language or start over?
Neither. If you want to extend a programming language, use a programming language designed for extensibility.

Hunter Smith
Hunter Smith

Terrified, mortified, petrified, stupefied…by (You)

Jack Bell
Jack Bell

being this anally hurt

Eli Morgan
Eli Morgan

discussing how to multiply $1.01 by $1.01 unironically
squared dollars
What did /dpt/ mean by this?

Attached: f522fe9a454f0bb8d08bd917057265d5.jpg (7 KB, 225x225)

David Morales
David Morales

worse, it uses . for everything with implicit referencing/dereferencing

Charles Campbell
Charles Campbell

It is a habit of mine playing with people's butts with any object I have in sight.
After all, I am scatman.

Adrian Allen
Adrian Allen

HAHAHAHA holy fuck this is so real

Jayden Wood
Jayden Wood

Feeling like finally learning a high level OOP language
should I learn C# or Java /dpt/?

Benjamin Peterson
Benjamin Peterson

Should I learn Microsoft Java or Oracle Java, /dpt/

Andrew Reed
Andrew Reed

what about core features and syntax modification?

Zachary Sanders
Zachary Sanders

Make sure you follow the 'fair use' rule when using Java(tm).

Julian Gray
Julian Gray

Not using IBM Java
developer.ibm.com/javasdk/downloads/sdk8/

Xavier Johnson
Xavier Johnson

yeah I guess it doesn't make that much of a difference
care to elaborate?

Jack Young
Jack Young

What does it even do?

Noah Sullivan
Noah Sullivan

what about core features
Are you walking about extending a language or redefining it?

and syntax modification?
Possible with some.

Christian Fisher
Christian Fisher

Oracle is killing Java. Use another jvm based program if you must.
On another note, what is your end goal of learning C#/Java? Just getting into high level OOP and nothing more?

Nathan Martinez
Nathan Martinez

There's literally nothing wrong with this.

Daniel Ortiz
Daniel Ortiz

Let's just say this extension requires defining stuff that are otherwise impossible to accomplish in a language.

Dominic Miller
Dominic Miller

Oracle is killing Java
what are they doing?
what is your end goal of learning C#/Java? Just getting into high level OOP and nothing more
basically, yeah
I thought it would be nice to know one of these languages more in depth

Dylan Foster
Dylan Foster

Oracle is killing Java.
what did he mean by this?

Asher Hill
Asher Hill

Let's just say this extension requires defining stuff that are otherwise impossible to accomplish in a language.
If your extension is incompatible with the core of the language, it's not an extension.

Blake Flores
Blake Flores

There's plenty of wrong with this.
It's hard-coded. The questionnums isn't used for anything but documentation (should be a comment).
It's also very error prone. If you think this structure is ok you should generate this code.
Of course you could also write it well.

Gabriel Sanders
Gabriel Sanders

They are killing everything nice in Java from frameworks to market and turning into a copycat of modern languages dozens of years later.

basically, yeah
Sigh. So there is no need for comparison then.
If even, learn C#, otherwise, use Java.
random.org/integers/?num=1&min=0&max=9001&col=1&base=10&format=html&rnd=new

Jaxson Cook
Jaxson Cook

Oracle is killing Java
no

Nicholas Ward
Nicholas Ward

Sigh. So there is no need for comparison then.
yes there is, as probably one language is considered by some better/nicer, so I would prefer learning that language

Brandon Thompson
Brandon Thompson

I'm learning Elixir! Very comfy.

Attached: happy.jpg (41 KB, 394x353)

Christopher Stewart
Christopher Stewart

why does the chicken look autistic?

Brayden Lewis
Brayden Lewis

Karen is not autistic, she is just cute.

Attached: motivated.png (311 KB, 599x587)

James Gutierrez
James Gutierrez

she assumes that code was generated by hand

Attached: 729.gif (137 KB, 340x340)

Hunter Kelly
Hunter Kelly

chickenshit

Dominic Lewis
Dominic Lewis

We really should assume that until stated otherwise.
Imagine some rookie comes on here and asks for help and they paste their code.
Then we all asks for the actual code that generated this and the rookie is left confused.
No that's silly. Until metaprogramming is the norm we need to assume otherwise to not encumber language.
Also if it's generated code it's poorly generated.
You don't leave unused variables. You don't use such a human pattern as a dictionary when you could make the more obvious code of iterating an array (list, in python?) of those values.
It's almost certainly more simple on the metaprogramming side than using this dictionary.

Nolan Miller
Nolan Miller

Rude.

Jaxson Cook
Jaxson Cook

metaprogramming is not the norm for her

Attached: sicp-girl.jpg (12 KB, 259x194)

Josiah Williams
Josiah Williams

sorry ur waifu is ok user
i like blondies
idk what anime shes from tho

Henry Moore
Henry Moore

Are you being willfully ignorant user?
Fuck you.

Austin Bailey
Austin Bailey

Are you even a programmer if you can't program your own waifu?

Brayden Phillips
Brayden Phillips

Have any good C-Meme?

Josiah Hall
Josiah Hall

Tfw configuring the fuck out of my setup.

Feels good man.

Liam Adams
Liam Adams

can't program your own waifu
Not program a waifu generator for unlimited waifu

Carter Brown
Carter Brown

program dose nothing
spend 2 hours writing error handlers for every function
forgot to specify that path name uses Unicode

Hunter Jackson
Hunter Jackson

You don't know how to debug a program?

Carson Rodriguez
Carson Rodriguez

It returned some random value so I assumed it worked.

Debugger won't tell me I missed that.

Jacob Butler
Jacob Butler

it compiles so it works
You're not programming Idris or something like that.
You can't assume such things.

Ryan Bennett
Ryan Bennett

O K

Next time I will exactly know what's the mistake and fix it right away instead of trying to find it. Silly me.

Matthew Miller
Matthew Miller

Are you being willfully autistic, or is it a genetic mishap?

James Torres
James Torres

it compiles so it works
thinking this is true in idris
thinking this can be true in any programming language
The utter delusion of typefags... Maybe when the compiler can read your mind and verify that your code actually matches your intent.

Logan Edwards
Logan Edwards

program correctness != logical correctness

Gabriel Gray
Gabriel Gray

having more than one waifu is bad for your laifu

Landon Stewart
Landon Stewart

No what I'm objecting to is 'spending 2 writing error handlers for every function'.
What I'd consider a normal debugging process is having an expected input and output. Reading a field of inputs mapped to outputs and see if they align with expectations (or ideally a reference implementation, we normally don't have this luxury).
If you don't get what you expect you pick one of the inputs that's wrong and track it through the program.
A bug like the one you had shouldn't have taken 2 hours, I'm sure you agree. So improve your process somehow.
I didn't claim this. What I'm saying is that his expectation is wrong since he accepted just a 'random result'. In languages like these (I don't know Idris. I just know it's type) the constraints put on the programmer make the process rigid as you go deeper into programs. That narrow path helps limit the possible approaches to the same (expected) result.
Which increases certainty of the result when the program compiles.

Stop assuming so broadly.

Colton Gonzalez
Colton Gonzalez

consistency = correctness
I guess every program ever written in a type-safe language is correct, isn't it, typetard?

Julian Sanders
Julian Sanders

Input doesn't match output. I'm using pointers with offsets. What now?

Asher Murphy
Asher Murphy

I didn't claim this.
it compiles so it works
You're not programming Idris or something like that.
You can't assume such things.
So you're telling me the above doesn't imply that you think "it compiles so it works" holds in Idris?

Sebastian Mitchell
Sebastian Mitchell

well the point is, if an idris program compiles you can almost guarantee it will have no RTE's. Which is leagues better than sepples and all other shitlangs.

Caleb Murphy
Caleb Murphy

Yes. It implies that it's an unreasonable assumption outside of very niche languages.
In these languages it's a reasonable assumption. The cost of being wrong is still high but the amount of times you're wrong is reduced so it starts being a more reasonable proposition.
I'm expressing my opinion that making these assumptions in most languages is foolish because you'll be wrong very often.
I'm not expressing that you're always right in assuming this in languages like Idris.

Is this really so hard for you?
Are you implying you can't verify the output of the program? Why would you even begin to write error checking routines for everything then? You've just declared your problem impossible to find without code inspection.
I don't believe that to be true. Usually you don't care about the pointers directly in this way. You care about their relationship to other parts of the program and more commonly the values they point to.
But you may hold that your approach of spending 2 hours on this was correct. I haven't seen the code.

Owen Nguyen
Owen Nguyen

well the point is, if an idris program compiles you can almost guarantee it will have no RTE's.
So you're telling me you can't try to read a value from an array unless you prove that the index is valid in Idris?

Lucas Parker
Lucas Parker

there's no reason whatsoever for this assumption to be true, but it's a reasonable assumption
Kill yourself.

Aiden Martin
Aiden Martin

What do mean by prove?
Like reading an index's value that doesn't exist?
That'd be a compiler error, yes.

Austin Gray
Austin Gray

I can't because there is non genius.

Now tell me where debugger tells me that I've missed an "L" before a quotation mark.

Aiden Perry
Aiden Perry

What do mean by prove?
I mean having to provide an index of the type Between(index, 0, arr.length) or something of the sort.

That'd be a compiler error, yes.
So if I read a positive integer, trying to use it to index an array is a compile-time type error?

Brayden Bennett
Brayden Bennett

So do I ask comp sci questions here, or is there a different thread for that?

James Baker
James Baker

Sup Forumscatalog#s=sqt

Jayden Barnes
Jayden Barnes

debugger
I think you're talking about the IDE now. Or other checking tools.
What you should have inspected is the result of a dependent operation. Using a debugger to inspect intermediate results of the program to narrow the search space.
This is debugger usage 101.

Wyatt Baker
Wyatt Baker

Either works.

Jason Jackson
Jason Jackson

Yes... random values thrown around really helped me find that. Thanks.

Julian Lewis
Julian Lewis

I mean having to provide an index
no, it literally just type-checks your program to make sure nothing invalid can happen.
So if I read a positive integer, trying to use it to index an array is a compile-time type error?
only if the index vs the arrary/list would be an invalid index.

Liam Garcia
Liam Garcia

no
In that case, you can read arbitrary indices and cause runtime errors, and you've just confirmed that you don't understand what dependent types are.

Juan Wood
Juan Wood

you can read arbitrary indices and cause runtime errors
You can read ones that exist, but you couldn't read any that'd cause an RTE unless you stumble across a compiler bug.
And no, I just think we have our semantics mismatched.

Camden Myers
Camden Myers

no reason
There's almost always reason for the assumption to be true in any language.
If your language outputs a binary when it has compile time errors you'd assume it's not correct categorically because any input can produce any output. Compilation completion meaningless for the correctness of the program. Since it doesn't usually do that you can make the assumption that it is true that the program is correct when you compile well. Some errors have been alleviated by the process.
The more errors it catches the better the assumption is.
As you said the 100% case is when your compiler has read the programmer intent. Or not even. It's probably when the end user intent is realized.
But assumptions aren't about 100% certainty.
When someone is using the blinker on their car you're not 100% certain they're gonna follow what that suggests. But you'd be very frequently correct in assuming that it indicates their actions.

I don't see why you're having such big issues dealing with these non-binary issues. I'm sure you do understand the word assumption and how it's not about 100% certainty.

Hunter Perez
Hunter Perez

Well, I'm fucking around with leftist trees. Mass insertion of elements takes O(n log(n)) time because a single insert takes O(log (n)) time. But a bunch of books claim it can be done in O(n) time by taking a LIFO queue, stuffing a bunch of single-element HLBTs in. Then, keep melding the first two HLBTs in that queue and adding the result back to the queue until there's only one element left.

In Mehta's Handbook of Data Structures (which has the only proof I've found), the proof is that this takes O(n/2 + 2 * (n/4) + 3(n/8) + ...) = O(n * summation (i/2^i)) time. Then they drop the summation and get O(n) time.

The thing is, I'm pretty sure the summation goes from i=0 to log(n), and therefore you can't just drop it like you would a constant. Am I misunderstanding something?

Joshua King
Joshua King

random values thrown around
Yes. Even random values can be evaluated by checking the distribution and seeing if it fits.
I know you want to be right but don't try to assert yourself as right at the cost of being right in the future.

I'm not gonna keep talking to you now.

Eli Harris
Eli Harris

You can read ones that exist, but you couldn't read any that'd cause an RTE
The compiler has no magical way of knowing if the index is valid or not at compile time, you LARPing typenigger.
Dependent typing 101: if you wanted to have an index operation with compile-time safety, you would have to make it accept only indices of a type like Between(index, 0, arr.length), which depends on the index itself and the length of the array (hence "dependent" typing), and values of which cannot be constructed without proofs that index >= 0 and index <= arr.length, meaning the type constructor itself would have to accept dependently typed values etc. I don't know Idris, but I find highly dubious the claim that it forces you to provide such proofs whenever you want to read a value from an array, especially considering that it could be dealing with arbitrary user-provided values, in which case it would need to have some way to express a runtime error anyway, and the same way could be used to make an "unsafe" indexing operation, so it'd be bizarre for the standard library to not just provide it.

Henry Hall
Henry Hall

not making waifu business

Eli Davis
Eli Davis

There's almost always reason for the assumption to be true in any language.
Stopped reading there. It's clear that you're mentally ill and desperately trying to save face.

Attached: 552334255.png (7 KB, 251x201)

Angel Rogers
Angel Rogers

Ok user. You spend 3 hours examining every pixel and wonder how he got there.

Eli Morgan
Eli Morgan

I don't care to listen
That's fine.
I don't force you to be right.

Brandon Sanders
Brandon Sanders

I don't know Idris
yeah i can tell.
It's gonna blow your mind when you discover type-checked state machines next.

Benjamin Diaz
Benjamin Diaz

if the program compiles then it's probably correct
in any language
bugs almost don't exist, guise

Attached: 3248283895.png (9 KB, 300x300)

Sebastian Long
Sebastian Long

at : ∀n a. Vec n a -> Fin n -> a
(not even dependent yet)
The input is:
A vector of a's, with length n
A natural number less than n

You can also write:
atUnsure : Vec n a -> Natural -> Maybe a
if the natural can be converted to Fin n (i.e. if it's less than n), you can call the previous function and return Just of that, else return Nothing

The functions themselves don't have any flaws, and aren't unsafe or anything.
They can connect up with other functions that have the same information, or less information (in which case you will need a test). How much information depends on where the input is coming from.

Isaac Adams
Isaac Adams

You haven't even understood what I'm arguing? What a sad state.
Good bye.

Wyatt Ross
Wyatt Ross

she doesn't know how to express the constraint that an index must be in range
she still claims to understand what dependent types are
I don't know why I bother anymore. This thread is populated mostly by subhuman-tier FB dropouts.

Jackson Gray
Jackson Gray

it's the mentally ill trap poster
ah, makes sense now

Zachary Smith
Zachary Smith

You haven't even understood what I'm arguing?
Nobody gives a shit what you're "arguing", animal, but anyone can see what you actually wrote, which was:
if it compiles it works
There's almost always reason for the assumption to be true in any language.

Ayden Diaz
Ayden Diaz

Guys, could you take a minute out of your busy schedule of shitposting and help me out, please?

Connor Taylor
Connor Taylor

at : ∀n a. Vec n a -> Fin n -> a
(not even dependent yet)
That can only work with arrays/vectors that have a size known at compile time.

atUnsure : Vec n a -> Natural -> Maybe a
Then the validity of the index isn't verified at compile-time; it's just the FP equivalent of returning an error code for an invalid index.

Nicholas Flores
Nicholas Flores

only if it's verified at compile time
The only thing that needs to be verified is that the input number is (Fin n) and the input vector is (Vec n a). Which n and which a can happen at runtime, because it's not like a template.
The latter one yes, isn't sure. But what it does, is it tests the natural, and once it knows it can be a Fin n - it can call the other function! With runtime input, which you said the other thing couldn't do.
Now obviously you can have these just sort of floating around, you can have areas of your code where you have a lot of constraints and proofs around and it eases the burden there.

For instance, the last element of a non-empty vector.
Since a non empty vector is
Vec (1 + n) a
You know that (n) can be converted to a (Fin (1 + n))

Jaxson Reyes
Jaxson Reyes

And all you need to check is either the length or the vector itself

isEmpty : Vec n a -> Maybe (m : Nat, n = S m)
isEmpty [] = Nothing
isEmpty (x :: xs) = Just Refl

Ryan Thompson
Ryan Thompson

But what you see here, is not _just_ the error handling you are used to, but we have actually got a great deal more information in the type.

Jacob Campbell
Jacob Campbell

oh the Just Refl bit is slightly wrong, it should be
Just (_, Refl) (assuming the compiler can infer it, m is in the type of xs)

Julian Roberts
Julian Roberts

If n is a value, how is a type which depends on n not a dependent type?

Oliver Cook
Oliver Cook

Are you that guy from the other day who thought C had dependent types?

Nathaniel Young
Nathaniel Young

I find highly dubious the claim that it forces you to provide such proofs whenever you want to read a value from an array
Well, it does
especially considering that it could be dealing with arbitrary user-provided values, in which case it would need to have some way to express a runtime error anyway
no, it forces you to handle that case.

That can only work with arrays/vectors that have a size known at compile time.
What? It's just dependent types man.

Then the validity of the index isn't verified at compile-time; it's just the FP equivalent of returning an error code for an invalid index.
The difference is that it always forces you to handle these, unless we're talking about partial functions.

Jason Garcia
Jason Garcia

And for that matter, what's the difference between what you wrote and the type I descried earlier besides notation? In either case, the function expects a value of a type that is a positive integer smaller than the length of the array.

Ryder Russell
Ryder Russell

It does, though.

Jonathan Collins
Jonathan Collins

my initial reading is correct you can't tell me I read it wrong
Wow seriously?
That's pretty hardcore. Who gave you the authority to decide the English language only applies to your interpretations? Is completely in line with the initial statement. It's anons evaluation that you could make such assumptions sensibly in languages like Idris but not in whatever he's guessing that guy with the error is programming in. If you agree on that judgment is another issue.

How can you even read this differently? The clarification makes it perfect.

Colton Roberts
Colton Roberts

Regardless, consider this:

∀(a : Type). a → a

∀(n : Nat)(a : Type). Vec n a → Fin n → a

We can think of "Nat" and "Type" as kinds. (I.e. types of types)
In a dependent type, a lower kind appears in a higher kind, e.g.

(A : Type) → (a : A) → F a
a is a term, but (F a) is a type. A term is occuring inside a type.
Similarly if you had a type occuring inside a kind, or a kind occuring inside a higher universe.

I wasn't part of the conversation earlier

Jace Miller
Jace Miller

constrained types != dep types

Grayson Fisher
Grayson Fisher

Well, it does
That sounds about as fun as stuffing needles up your pisshole.

It's just dependent types man
If you read his post, he claims it's not a dependent type. My claim from the start has been that you'd have to provide an index of a dependent type which depends on the index itself and the length of the array.

no, it forces you to handle that case.
What's the difference? Instead of just dying with an exception, you'd have the program return a value of some option type and use monads or whatever to hide the plumbing. It's still just a runtime error.

Caleb Thomas
Caleb Thomas

what are variably modified types

Bentley Perry
Bentley Perry

so in Haskell, with GADTs and DataKinds, we could write this

-- because of DataKinds:
-- kind Natural = 'Zero | 'OnePlus Natural
data Natural = Zero | OnePlus Natural

-- also using KindSignatures but this annotation isn't necessary
-- n is a TYPE of KIND Natural
-- NOT a TERM of TYPE Natural
-- so we have a type parametrised by a type, a generic, NOT a dependent type
data Vector (n :: Natural) (a :: Type) where
EmptyVector :: Vector 'Zero a
NonEmptyVector :: a -> Vector n a -> Vector ('OnePlus n) a


But this isn't dependent typing.

Leo Nelson
Leo Nelson

I spent an entire day configuring i3 , and emacs . Wrote some elisp to switch between light and dark solarized. Discovered ranger now I am going to set up file associations , wondering if I should setup file associations with ranger or the more complicated xdg .
Oh and, Linux stopped playing audio and video . That's next on my list.

Joshua Rodriguez
Joshua Rodriguez

repeatedly ignoring the questions
repeatedly deflecting
engaging with extremely obvious false-flaggers
Is that the final state of /dpt/ type shills? Please tell me more about how a type that depends on a value is not a dependent type while the other shill screeches "it's just a dependent type, bro".

Nathan Hughes
Nathan Hughes

if it compiles it works
There's almost always reason for the assumption to be true in any language.
bugs almost never happen
Time for you to kill yourself.

Michael Williams
Michael Williams

is there a way to shrink this

Attached: spurdificator.png (8 KB, 289x580)

Gabriel Cooper
Gabriel Cooper

just install vs code, lad.

Logan Morris
Logan Morris

Resize the image and crop the sides.

Gavin Powell
Gavin Powell

Make and index a map.

Julian Phillips
Julian Phillips

It has to be a term occuring inside a type (or a type occuring inside a kind, which is really a type-level term occuring inside a type-level type)

Camden Ramirez
Camden Ramirez

install regex

Noah Sullivan
Noah Sullivan

It has to be a term occuring inside a type
So is `n` not a value? Or is it not a term? Or does `n` not occur in `Fin n`? Or is `Fin n` not a type? Or does `Fin n` not occur the overall type of the index function?

Noah Carter
Noah Carter

He never said #1 and #3. That's straight up strawman.
#2 is misrepresented clearly. The point was that there's almost always reasons. But that doesn't make making an assumption an effective choice. You probably don't even disagree with what's being said, you're just too stupid to understand it apparently.

Liam Myers
Liam Myers

It depends on the language. I have chosen to show you that it is possible without dependent types, and thus there isn't much point associating it with them.
In the case
∀(A : Type). A → A
You can clearly see that it is a type variable occuring inside a type. A is a type, appearing inside a type, not a term inside a type. Similarly, you can have a kind "Nat", and thus write the function earlier without dependent types.

Camden Moore
Camden Moore

Working with databases but confused about schema-less stuff.
With a document-store, if its attributes are not defined in a schema, when and where are they defined?

Levi Fisher
Levi Fisher

He never said #1 and #3. That's straight up strawman.
"He" (You) literally said that there's almost always a reason for the assumption "if it compiles, it works" to be true in almost any language, so it follows this schizo thinks there's almost always a reason to assume that bugs don't exist in a program written in any language. You can screech that I'm misinterpreting things you stated repeatedly, but it just makes you look even more mentally ill in your futile attempt to save face.

Joseph Nguyen
Joseph Nguyen

is the number of possible questions for this 12^12*3 ?

Blake James
Blake James

i mean (12^12)*3

Angel White
Angel White

Haskell:

import Control.Monad
questionNums = 12
possibleAnswers = "ABC"
answers = replicateM questionNums possibleAnswers

Jacob Adams
Jacob Adams

It depends on the language.
So let me get this straight:

at : ∀n a. Vec n a -> Fin n -> a

Is `Fin n` not a dependent type because `n` isn't a term that occurs in the type definition, or is it not a dependent type because `n` is not a value?

Liam Bell
Liam Bell

Is there a way to default to a class template specialization in sepples?
Like

 
myvector<> myvectorobject;
myvector<int> myvectorobject2;
//these are now the same type because myvector 'defaults' to int

Jeremiah Bennett
Jeremiah Bennett

obviously you could also write

replicateM 12 "ABC"
since that's the expression itself

In some languages, n would be a term, in some languages (e.g. Haskell) it would be a type. Both languages use similar syntax, with dependent types it becomes more flexible. Since it is possible in non-dependent languages, we shouldn't call it dependent. "a" certainly isn't a term, and it's possible that n isn't either.

Landon Bennett
Landon Bennett

if you have 12 questions and three possible answers for each, i believe it's simply 12^3

Joshua Bennett
Joshua Bennett

template <typename T = int>
struct myvector { /* ... */ };

Jaxon Turner
Jaxon Turner

Basically:

at : ∀(n : ℕ) (a : ). Vec n a → Fin n → a

Whether ℕ is a type or a kind (like ) depends on the language, and on ℕ.
In a non-dependently typed language, ℕ must be a kind.
In a dependently typed language, it could be either.

Andrew Wilson
Andrew Wilson

oops, the star didn't show
(a : *) ... (like *)

Sebastian Green
Sebastian Green

In some languages, n would be a term, in some languages (e.g. Haskell) it would be a type.
We were talking about dependently-typed languages and array bounds checking.

Since it is possible in non-dependent languages, we shouldn't call it dependent.
So because the notation could mean something different in a completely different and irrelevant context, nothing is a dependent type? Brilliant.

Angel Johnson
Angel Johnson

No, I'm saying because you can achieve the same phenomenon without dependent types, and dependent types are strictly more powerful, why attribute it to dependent types?
In a dependently typed language you can have a type for booleans, but you shouldn't go around saying bools are dependent

Camden Sullivan
Camden Sullivan

That sounds about as fun as stuffing needles up your pisshole.
It sounds like a lot more trouble than it is. If the logic of your program is sound, it's not much work most of the time.

If you read his post, he claims it's not a dependent type
The guy just didn't understand that you mean dependent types with "having to prove the index is valid". (and probably doesn't know what dependent types mean)

What's the difference?
Are you serious?
1. It's a lot easier to localize errors.
2. You can save a lot of retarded unit tests
3. No undefined behaviour and everything that comes along with it
4. A program dying is basically the absolute worst case. How often is it that you really can't recover?

And that's ignoring that a lot of runtime errors (and errors in general) are just programmers being careless, which you can prevent a lot of the times with more strict type checking.

I couldn't think of a single case where not doing so would be beneficial.

Aiden Phillips
Aiden Phillips

if you have 12 questions and three possible answers for each, i believe it's simply 12^3
If you have 3 decimal places, and 10 possible digits for each, do you have 3^10 numbers?

Jace Diaz
Jace Diaz

Thanks.

Luis Price
Luis Price

you can achieve the same phenomenon without dependent types
How do you produce a proof that an index is smaller than the length of an array without referring to the length of an array in the proof? Just FUCK. I cannot believe I am having this "debate".

Kayden Howard
Kayden Howard

The length of the array can be a type. It needn't be a term.

Adrian Jones
Adrian Jones

"he"
He.
literally said [...] almost any language
Yes.
so it follows
This is your assumptions about what's being implied yes. But what's actually said is what's literally there. 'there's almost always a reason'.
Do you need the word reason explained to you? If you have an arbitrary reason that's not enough usually. A reason can be 'it feels right' (I intuit it to be correct).
When your reasons are strong enough you start to _assume_. But you're still not correct, you're assuming. You've weighed the costs of being wrong and decided that presuming you're correct is better in this instance. It'll take less time overall maybe. Then there's an additional step which you seem to believe he's arguing that is that it's 'proven' correct. I don't see that at all. A person who think that doesn't use so many qualified statements.

Brody Butler
Brody Butler

user, please don't sleep in school. This is basic combinatorics.
If you draw a tree diagram it should be obvious. You have a branching factor of 3 and a depth of 12. How many leaves are there?

Nathan Williams
Nathan Williams

iz dhere a way do zhrink dhiz :D

Bentley Reyes
Bentley Reyes

i think so
look up permutations and combinations. the formal way to denote it is C(n, r) but i can't remember if n is the number of "spaces" or available things to fill the spaces.

Charles White
Charles White

Are you serious?
I'm not saying there are no advantages to this approach. I'm saying that if you have an index operation that returns a Maybe result, and your program doesn't know what to do with a Maybe except propagate it all the way back, then this is not inherently different from a runtime error. I'm also saying that this could occur as a result of a programming error unless you actually go with the other approach of proving each array access is valid.

Jacob Cook
Jacob Cook

doesn't know what to do with a Nothing/None*

Carter Nelson
Carter Nelson

Sup Forums what is difference between -Wpedantic and -Wall

Ethan Gutierrez
Ethan Gutierrez

So one way is to do this:
Pattern match on both the Vec and the Fin.
If the vector hits empty first, then the Fin is too big.
If the Fin hits 0, and the vector is not empty, then the Fin is not too big.
Pattern matching on the constructors emits equality constraints (that's how GADTs work).

Jayden Myers
Jayden Myers

The length of the array can be a type.
So if you have an array that is 10 elements long, 10 is not a value?

Xavier Gomez
Xavier Gomez

-Wall doesn't actual enable all the warnings, just most of them.

-Wpedantic turns on the most warnings.

Josiah Lewis
Josiah Lewis

so, 36 possible permutaions. got it

Juan Torres
Juan Torres

Pattern match on both the Vec and the Fin.
They both refer to n, so unless you want to claim that for a Vec of 10 elements, n is not the value 10, but rather a type, your response is irrelevant.

Austin Sanders
Austin Sanders

i think so
user... 3 decimal places. 10 possible digits. How many possible numbers? Is it 59049 or 1000?

Alexander White
Alexander White

I suggest you do as they said and draw it.

Levi Howard
Levi Howard

there are no advantages
1) First, there is this myth that you don't get any extra benefit from input or output. We know that input and output conforms to certain standards: the main function is called with an int n, and a list of n arguments. An existential pair (if you treat them as terms, dependent). Other things for other functions, which we know follow certain protocols. It is like saying that all IO should have a void* return type. We know getChar(), if it succeeds, gets a char and not a double.

2) If you imagine you have an (Either e a). e is some sort of exception, or a is a result. There are two cases. Within your handlers for those two cases, you have much more information. Not to mention what the whole thing tells you

(n : Integer) -> Either (even n) (odd n)

You can have a term 10, AND a type 10. Or one and not the other.
Again, it depends on the language. GHC/Haskell has (awkward) ways to convert between term level natural numbers and type level natural numbers.

they both refer to n
As I said, n can be a TYPE of KIND natural. Pattern matching on the constructors for Vec and Fin releases equality constraints about that n.

Camden Sanchez
Camden Sanchez

new thread, though
supforums.com/thread/65302096/technology

Attached: consider.jpg (29 KB, 600x600)

Julian Scott
Julian Scott

He's saying it _needn't_ be a term, not that it never is a term.

Austin Ramirez
Austin Ramirez

1000

Asher Collins
Asher Collins

thx

Nathaniel Turner
Nathaniel Turner

i can prove that an arbitrary index is valid for an arbitrarily-sized array without ever referring to the array itself or its size in the proof
Mental illness.

Wyatt Jenkins
Wyatt Jenkins

deliberately misquoting
Stopped reading there.

Joseph Rogers
Joseph Rogers

What the fuck are you talking about? And I seriously hope you didn't just make this bullshit claim having made up a completely imaginary point.

Juan Williams
Juan Williams

You do refer to the size, it's just a type and not a term.

Jordan Martin
Jordan Martin

What the fuck are you talking about?
Do you understand what an array is, my autistic friend? Do you understand what bounds checking is? If you wanted to prove that a given index is valid in a given array, would your proof have to refer to the index and the array size (or the array itself) in some manner? Are indices and arrays (and their sizes) values in the context of everyday programming?

Jonathan Miller
Jonathan Miller

I wish dependent types were everyday programming

Sebastian Perez
Sebastian Perez

That's the thing though. You'd normally prove each array access is valid at the level of your actual program logic and most of the uncertain stuff happens near the top. If you do some operations on an array and have Maybe as a return type because there is the possibility of critical failure, you're probably doing something wrong (or at least, not in the way these languages should be used)

when talking about the advantages you missed a no. He was using a double negative (i.e. there are some advantages)

Jonathan Rivera
Jonathan Rivera

an array has 10 elements
10 is a type and not a value
I guess if you want to be really autistic about it, you could say that 10 is a proof of itself, so 10 is a type, but nobody cares about this. Just take your ultra-autism somewhere else.

Adrian Morgan
Adrian Morgan

Oh, I didn't see that. Anyway, I think both my points are still relevant

Parker Jones
Parker Jones

Your array can have type indexed length. Since we are talking about the Vec example, this is the case. In a dependently typed language, it could also be term indexed. In the case of the at function, it needn't be dependent supforums.com/thread/65302096/technology

Disable AdBlock to view this page

Disable AdBlock to view this page

Confirm your age

This website may contain content of an adult nature. If you are under the age of 18, if such content offends you or if it is illegal to view such content in your community, please EXIT.

Enter Exit

About Privacy

We use cookies to personalize content and ads, to provide social media features and to analyze our traffic. We also share information about your use of our site with our advertising and analytics partners.

Accept Exit