[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 316
Thread images: 19

File: 1480916491815.png (102KB, 1000x1071px) Image search: [Google]
1480916491815.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58168017
>>
>>58174411
>>58174320
>>
Functional Programming Thread:
>>58174033
>>
Are there any real projects where Rust is used?
>>
>>58174947
anyone?
>>
>>58174947
The new browser from Mozilla?
>>
>>58174947
https://www.rust-lang.org/en-US/friends.html
https://github.com/kud1ing/awesome-rust#applications-written-in-rust
>>
>>58174411
and you ruin a perfectly good pic. thx op for fucking up christmas
>>
should I learn Swing or JavaFX?
>>
>>58175320
Neither.
>>
>>58175320
Swing is deprecated, AFAIK, so JavaFX must be better.
>>
not programming on vacation fuck off
>>
>>58175578
Then you fuck off. We're not going to not create a thread just because you're on vacation you little shit.
>>
>>58175578
xD fuck programming amirite
>>
>>58175174
What new Mozilla browser?
>>
>>58175725
https://github.com/servo/servo
>>
>>58175743
>64-bit only
Why?
>>
>>58175901
32bit is deprecated
>>
>>58175901
>2016
>32-bit
Not everyone is a retarded winfag.
>>
>>58175909
But everything works just fine.
>>
>>58176197
It won't forever.
It bothers me that there are going to be idiots like you still using 32-bit computers in 2036.
>>
>>58176240
>2036
2038*
>>
>>58176240
>implying time issues are caused by 32-bit computers, but not by wrong choice of time storing value
>>
>>58176334
It doesn't matter when they picked the value. It just means that the problem would happen at some other time.
64-bit makes the range so large, it'll literally be hundreds of billions of years before it's an issue.

Even then, there are plenty of other reasons why it's stupid to target 32-bit (x86) computers.
>>
I suppose it's not possible to create some OS for smartphones that wouldn't be slow?
What would be your ideal smartphone OS?
If there were some cheap smartphone-like device with ROM BASIC, would it be nice?
>>
>>58175931
At least on x86 running 32-bit code is generally faster than 64-bit due to smaller pointers and smaller opcodes (i.e less data and instruction cache pressure).
There are cases where the reverse is true of course, like heavy usage of > 32 bit arithmetic, or certain algorithms where more registers are useful, but they tend to be rare cases.
>>
>>58174411
Could someone please expand on what the following C code means:
pte_t *pte = myMemoryAddress;
if(pte-> &~_PAGE_RW)
{
pte->pte |=_PAGE_RW;
}

I can't even find the right query to google to get an answer. From my existing understanding its flagging the memory page as read writable, what i dont understand is the operators used in the conditional.
>>
>>58176486
Did you forget a pte?
pte->pte & ~_PAGE_RW

This tests for all bits not set in _PAGE_RW
>>
>>58176506
Yes i did for it, and thanks; so & == bitwise comparison then ~ == not?

Sorry, never had to work with bitwise operations in C# before.
>>
>>58176449
>At least on x86 running 32-bit code is generally faster than 64-bit due to smaller pointers and smaller opcodes
There is FAR too much going on to be able to day a massive general statement like that.
Also, x86 is missing a bunch of instructions added in AMD64 and things like all of the SIMD shit added.
>>
>>58176422
>If there were some cheap smartphone-like device with ROM BASIC, would it be nice?
There are plenty of ARM dev-boards out where, Raspberry Pi 3 is pretty much typical smartphone with ARM8 and 1Gb RAM.The only thing they lack is GSM/3G/4G chips, but you can buy it as a separate module.
>>
>>58176528
& stands for bitwise AND
~ stands for bitwise NOT
| stands for bitwise OR
^ stands for bitwise XOR
Do you even boolean logic, man?
>>
>>58176578
>day
I don't even know how the fuck I made that mistake. Maybe I clicked the wrong option on a correction.
Anyway:
make*
>>
>>58176609
No i've never had to use it before. I just remembered || was or and && was and. Never had to touch the others.
>>
>>58176197
Except that 32 bit would limit the browser to only using 3.5gb memory.
The way modern web development is going, that's barely the Hello World framework microservice library microtransaction.

Let's face it, it's perfectly normal for web-pages to gobble memory like they had diabetes, and DDR was an acronym for Delicious Diabetes Remedy.

Also, we've had 64 bit CPUs now for about a decade. And they work with older 32-bit software. So there's no reason to hold back anymore.
>>
>>58176630
I hope you're just learning C.
>>
>>58176578
> There is FAR too much going on to be able to day a massive general statement like that.
Not him, but this is basically a common knowledge, 32bit is generally faster, that's why stuff like x32 ABI for linux exist - https://en.wikipedia.org/wiki/X32_ABI .
> x86 is missing a bunch of instructions added in AMD64 and things like all of the SIMD shit added.
Most of the new instructions, AVX including, are available from 32-bit mode.
>>
>>58176649
day 2 my friend, no need for the passive aggressiveness.
>>
>>58176661
Not him, but you shouldn't have mentioned C# here, bitwise operations are just as useful in both languages. You're giving C# users a bad name.
>>
Is there a more elegant way of storing this data in Java files, without the need for external libraries?

    //new ExtractableObject classes need an entry in these two maps 
public static Map<String, String> identifiers = new HashMap<String, String>();
static {
identifiers.put("Substance", "R");
identifiers.put("SubstanceSynonym", "RN");
identifiers.put("Company", "FI");
}
public static Map<String, String[]> parameterkeys = new HashMap<String, String[]>();
static {
parameterkeys.put("Substance", new String[] { "RecordIdentifier", "Node ID", "CAS Code", "EU Index Code", "EINECS Code", "GADSL Duty to declare", "GADSL isUnwanted", "GADSL isProhibited",
"isReach", "isHidden", "isDeleted"});
parameterkeys.put("SubstanceSynonym", new String[] {"RecordIdentifier", "Node ID of basic substance", "Synonym ID", "ISO Language", "Synonym"});
parameterkeys.put("Company", new String[] {"Record Identifier", "Company ID", "Company Name", "Street", "Postbox", "Country Code", "Postal Code", "City", "Is Deleted",
"Is OEM", "Duns - Number"});
}
>>
am I mistaken or does C++ lack a direct Swing equivalent?
>>
is there a flag for gcc to have it not get rid of 'dead' code when optimizing?
>>
Should I learn F#?

Is F# related to OCaml the same way that Scheme and Racket are related to Lisp? Is F# just an OCaml dialect? Or am I being dumb?
>>
>>58176680
https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html

Consider using one or more Properties files, and just load it on startup.

Doesn't use external libraries, and actually works.
>>
Lua or Harskell?
>>
>>58176694
>what is Qt
>>58176703
Yeah, why not. F# started as OCaml for .NET, but since then it added a lot of unique and interesting features.
>>
File: 1482320687348.jpg (42KB, 790x494px) Image search: [Google]
1482320687348.jpg
42KB, 790x494px
>>58176661
Then it's fine.
Bitwise operations operate with bits, each bit for each bit.
AND gives 1 on both 1 operand bits
OR gives 1 on any 1 operand bits
XOR gives 1 only if one of bits is zero and the other is one.

So, construction
pte->pte |=_PAGE_RW;

sets all bits in the pte->pte by the pattern given in _PAGE_RW.
Cheers!
>>
>>58176718
>scripting language vs multi-purpose functional language
No shit.
>>
>>58176718
Rust.
>>
>>58176726
Thanks that clarifies it well, also is there any documentation on the page table entry struct? I can't find anything for it.
>>
>>58176713

Thanks, I will take a look at it.

Another question. I have a HashMap<String, String[]>. How do I access the first value of the String[]?
>>
/sp/engineer here

i dont know you guys like this autistic shit

I gave up after knowing my 10k line code was fugged by a ";" and it took me all day to find out

ffug /g/
>>
>>58176759
>I gave up after knowing my 10k line code was fugged by a ";"

>what are IDEs
>>
>>58176743
http://lxr.free-electrons.com/ident?i=pte_t
>>
I'm setting up a vichan instance to prepare for moderation policy tests (I want to see just how hard or easy it would be to make 4chan great again with pure proper moderation and policy change). I'm almost done aetting up but the host is kind of a shit and perms are fucked so I had to manually finish the install process.

There were no outstanding errors or warnings beside the perms issues and associated failures at step 4 of install, and everything seems to work beside one partially important issue: trying to upload files resultin the text "embedding error" appearing instead. I see the json, thumbs and db contents appear correct though.

Any idea what's wrong?
>>
File: 1482317263207.jpg (37KB, 520x390px) Image search: [Google]
1482317263207.jpg
37KB, 520x390px
how do i directly connect to sql .db file from python?
>>
>>58176652
>that's why stuff like x32 ABI for linux exist
I know about x32. Nobody really uses it though, as the benefits aren't really worth it.
After a quick search about x32 benchmarks, people seem to think that the performance gains aren't really there.
https://blog.flameeyes.eu/2012/06/debunking-x32-myths/
>Most of the new instructions, AVX including, are available from 32-bit mode.
Yes, but on 64-bit processors.
If you're using a "normal" 32-bit x86 processor, you cannot guarantee that those instructions exist, and you're forced to cater to the lowest common denominator.
>>
>>58176805
open()?
I believe there's some ODBC driver.
>>
File: 1477576769912.png (299KB, 680x598px) Image search: [Google]
1477576769912.png
299KB, 680x598px
>>58176700
>tfw to smart too receive replies
>>
>>58176700
-fno-dce -fno-dse -fno-tree-dce
>>
>>58176700
>>58177153
-Og
>>
>>58177192
these do absolutely nothing

>>58177193
this enables code elimination

I have -Og enabled and it would be useful to 'unset' the -fdce flag

apparently, not all flags have a 'no' variant
>>
>>58177228
have you put -Og before or after the fno?
>>
>>58177264
before
>>
File: last.png (649KB, 711x1058px) Image search: [Google]
last.png
649KB, 711x1058px
Working on a sixel encoder/decoder, just finished with the encoder, trying to figure out how to compress shit even further, seems to be impossible tho.

That image when converted to sixels is 7.1MB large, it takes a shitton of time to generate but less to render.
>>
Why do need to enable 10 language extensions to write anything useful in Haskell?
>>
>>58177298
Base level Haskell already competes with most other languages. Extensions are just like super saiyan.
>>
>>58177308
> Base level Haskell already competes with most other languages.

What bout strings tho?
>>
Anyone good with OpenGL here? I has question.
>>
>>58177318
pack
>>
I'm learning Django.
>>58177324
How about you ask the question and see if someone replies?
>>
>>58177335
I guess I can try that.

I'm wondering if it's possible to have a large number of textures in GPU memory. Like thousands.

I know there's often a limit on how many shaders you can "bind" in OpenGL, like 16 or 32.. and I gather that just limits how many textures I can render with one draw call. But I'm wondering if I make 100s of draw calls a frame, can I a thousand different textures without having to copy them to and from GPU each time I change the bindings?
>>
#include <stdbool.h>
>>
File: 1474537484767.png (9KB, 426x364px) Image search: [Google]
1474537484767.png
9KB, 426x364px
What kind of language can I make to be it useful?
>>
>>58177371
The amount of textures bound at the same time is limited by the number of texture units.
You can have more textures in GPU with most of them unbound.

Also, if you need a lot of 2D textures, I think you could use a 3D texture (it's a collection of 2D ones).
>>
>>58177394
Make a proposal to the C++ committee to add non-trivial designated initializer lists for arrays in C++17.
>>
>>58177394
Make a proposal to the C++ committee to add static_if in C++17.
>>
>>58177394
Pure functional that allows for direct memory management with guarantees
>>
>>58177423
if constexpr is in C++ 17

>>58177415
>>58177423
Don't bother, you can't save the language.
It needs to fucking crash and burn; the sooner the better.
>>
>>58177424
>direct memory management with guarantees
>System runs out of memory
What now faggot? Pretend it succeeded?
>>
>>58177434
I just don't get why they don't add such a basic and useful feature to the language that has existed in C since 1999. What the fuck is their problem
>>
>>58177438
malloc :: Representable a => Memory m (Maybe (Pointer a))

or
malloc :: Representable a => Memory m (NPointer a)
>>
>>58177460
Take this gibberish to /fpt/ and keep it there.
>>
>>58177471
It's a type signature, anon.
>>
>>58177471
this is better:

malloc :: (MonadMemory m, Representable a) => m (Maybe (Pointer a))


malloc ::

the type of malloc is

(MonadMemory m, Representable a) => 

Where m has a MonadMemory instance, and a has a Representable instance

m (Maybe (Pointer a))

A monadic action in m, returning a Maybe (Pointer a)
i.e. it might return a pointer to a, or it might not
>>
>>58177503
>i.e. it might return a pointer to a, or it might not
Then it's not a guarantee then is it, it's just a retarded version of C stdlib malloc which does the exact same thing.
>>
File: 3676756423.jpg (58KB, 480x1084px) Image search: [Google]
3676756423.jpg
58KB, 480x1084px
>>58177392
I know C is all about being as small of a language as possible, but bools should really be in the language
>>
>>58177529
I didn't mean one that guarantees allocation, I meant that guarantees stuff like no GC if you manually allocate a bunch

And unlike C's malloc, you would make sure
Pointer a
Cannot be null. So if you want nullptr, you need
Maybe (Pointer a)
And if you pattern match on that, and get some Just p, then you know it's not a nullptr
>>
>>58177547
bools are cruft dreamt up by enterprise jerks
>>
>>58177547
Why?
It's flexible just without them.
I've even forgotten why bools even existed.
>>
>>58177547
C isn't a very small language desu.
>>
>>58177547
CPUs don't have anything like bool. C isn't about being small, it's tailored to the way CPUs work. Switch statement is the perfect example.
>>
>>58177612
CPU don't have anything like structs, enums, loops and functions either, yet C has them. There is really no reason to leave bool out, and they realized it when they added _Bool and stdbool.h in C99.
>>
>>58177660
Why it's some external library but not some internal type them?
>>
>>58177660
Pointers of different types would be a better example - those are just byte sequences with occasional padding(afaik fasm has structs).
>>
>>58177547
I agree. It doesn't make sense to make an enumeration for it.
>>
>>58177685
It's an internal type called _Bool - http://en.cppreference.com/w/c/language/arithmetic_types#Boolean_type , stdbool.h header just aliases it to bool.
>>
>>58177547
Because the type system is weak anyway and it's still going to use !0 to check for truthiness.

Just use an int.
>>
>>58177696
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html

OH MY GOD HOW WILL WE POSSIBLY SURVIVE WITHOUT THIS IN THE BASE LANGUAGE
>>
>>58177715
>Just use an int.
I'll use a char, thankyouverymuch
>>
Is there i should know before i start learning Entity framework and SQL databases? Some best practice tips? Some usual fuckups to avoid?
>>
>>58177405
interesting..

What's the difference between bound and unbound textures exactly?
>>
>>58177405
>>58177766
The 3D texture idea sound pretty compelling too..

Got any recommended reading material? I've had a hard time finding stuff that gives me a real solid understanding of what actually happens with textures in OpenGL. When do they get copied back and forth from system memory to GPU memory and why, and how can I use multiple ones exactly. Most stuff seems to fudge over that stuff since most OpenGL stuff doesn't tend to care too much about it.
>>
>>58177725
I will survive without but no reason not to include this integrally like any other language. But who cares I use C++ all the time if I want to go low level. It's far more advanced and extensive then archaic C. Templates, classes and the std lib is better.
>>
>>58177547
_Bool
>>
File: like a glove.jpg (105KB, 615x635px) Image search: [Google]
like a glove.jpg
105KB, 615x635px
>>58174411
Aesthetic?
>>
>>58177808
wpf?
>>
>>58177808
Make the colors more posh.
>>
>>58177808
not too bad
>>
File: ok.jpg (39KB, 800x800px) Image search: [Google]
ok.jpg
39KB, 800x800px
>>58177747
Which then gets padded to word size, and you're still using 32 bits.
>>
>>58177853
chars are more bespoke and artisanal
>>
>>58177853
Don't be stupid, chars/bools are padded only if alignment requires it: https://godbolt.org/g/AsqZgQ , and you can always pack your structs.
>>
>>58177866
I keep my bools as individual bytes which are packed into an int

no one steal my idea
>>
>>58177394
Rust except with full linear and dependent types and call-point checking instead of def-point. Bonus points for improved syntax.
>>
>>58177906
>assuming your code won't run on system where sizeof(char) == sizeof(int) is true
>>
File: blocks.png (475B, 210x30px) Image search: [Google]
blocks.png
475B, 210x30px
>>58177815
Allegro

>>58177822
What should I change?
>>
>>58177966
>deprecallegro
Is this the year 1995?
>>
>>58177956
Machine word is usually twice the bits.
>>
How much would a query that returns <5rows with 3-4 columns with ~10letter strings each be in size? 10kb? More, less?
>>
Is this any good?
>>
>>58178108
Just great.
>>
File: qt.jpg (4KB, 112x85px) Image search: [Google]
qt.jpg
4KB, 112x85px
>>58178108
I think I might be retarded.
>>
>>58178132
PyQt is nice
Qt in C++ is a huge pain in the ass
>>
>>58178171
Why is there no good open source UI frameworks?
>>
>>58176748
hashMap.get("key")[0];

// Alternatively:
String[] strArr = hashMap.get("key");
String val = strArr[0];
>>
>>58177438
If you have manual memory mangement, do you magically avoid running out of memory?

No.
>>
>>58178233
It's not that Qt is not good it's just that UI development is a masochistic endeavor that's too far removed from actual programming to be enjoyable.

Maybe look into sockets/requests and do a browser-based interface instead.
>>
>>58177596

It's to force Pajeet to be explicit in his curry-stained desires.
>>
>>58178233
Gtk.
>>
>>58178328
I like Cocoa and WPF though. Most people seem to agree they are nice. Everyone seems to think QT is crap though.
>>
Why can't everyone just use HTML for UI design?
>>
>>58178365
because it horrible and slow
>>
>>58178049
That depends entirely on the letters, and the transport protocol, doesn't it?

You could for example get it back as CSV.
2,3 commas and a newline for each row + two to three times "10 chars" + space for escaping commas + the headers.

Let's go with 100 bytes per line to be maxing out. We're now at less than a singular kb.
Then you have to add on headers and shit.
>>
>>58177547
_Bool is a built-in type.

>>58177808
add a ghost block
>>
>>58178390
>letters
Latin standard

> transport protocol
tcp, i guess?

>Then you have to add on headers and shit.

How much the headers take usually? What if use Entity framework for example, which hass pretty high level sql libraries?
>>
>>58178381
It's as slow and horrible as browser renders it.
>>
>>58178381
It only has to be parsed once.
>>
>>58178457
yes, which is generally very slow and very horrible
>>
>>58178499
It's still slow
>>
>>58178503
My experience has mainly been with TensorBoard and iPython which are both pretty responsive. What are you basing this on?
>>
>>58178540
HTML UI
>>
Should I fall for the Rust meme? I use C++ for thesis work and small projects (no low level stuff, by the way).
>>
>>58178365
100MB of RAM just for the layout engine.
>>
>>58178594
Have you considered D?
>>
>>58178365

> Bring the web mess into desktop

kys
>>
>>58178613
Not really. Most of my work are not low-level stuff, but performance is a factor (not really a major factor, but as want rather). I'm also thinking of using Python because I want to implement my ideas in the fastest way possible (but the downside is that Python is slow).
>>
>>58178661
D is a high-level language. Python is not slow if you know what you're doing.
>>
>>58178704
Elaborate.
>>
>>58178661
Haskell
>>
>>58178704
Python is slow
>>
>>58178723
About what?
>>
>>58178740
>Python is not slow if you know what you're doing.
>>
>>58178749
Python is slow regardless.
"Fast Python code" is code that does nothing but call C code
>>
>>58178594
Yes, it's worth looking into, at least it tries to bring something new, not repacking the same ideas with slightly different syntax.
>>58178613
D isn't an alternative to Rust, it's a GC language. There is basically no reason to use D right now, if you want GC language you'd be much better off with C# or Java.
>>
>>58178777
You can do NoGC code
>>
>>58178749
Python is not for number crunching. If you have that, write the intensive code in e.g. C and call from python. Or use Numpy.

Python is for macro-operations.

Python is for IO-bound code, not CPU-bound.

Also, watch this presentation: https://www.youtube.com/watch?v=7eeEf_rAJds
>>
>>58178803
translation:
>Python is slow, but it's not meant to be fast anyways.
thanks
>>
>>58178803
if you're thinking of using Python

use Haskell instead
>>
>>58178777
Rust also has optional GC.
>There is basically no reason to use D right now
Except when you want a kick-ass language.
>f you want GC language you'd be much better off with
>C# or
Not everyone wants to be closed in MS's world.
>Java.
Shitty language.
Plus, D is high-level, while being natively compiled, versus bytecode.
>>
>>58178830
>Not everyone wants to be closed in MS's world.
What did he mean by this?
>>
>>58178830
>Shitty language.
JVM is nice though.
>>
>>58178811
Translation: I'm using a screwdriver to hammer a nail.
>>
>>58178830
>Rust also has optional GC.
But that's wrong.
>>
>>58178848
Well, then use Scala. Java is objectively shit. C# is Java done properly. If you can swallow mono and large memory footprint, use that.
>>
>>58178830
>Except when you want a kick-ass language.

Wow, you sure convinced me!
>>
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
int
long
register
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while

These are C's keywords you need to learn
Does C have more terms and keywords? Where can I learn them?
>>
>>58178845
.NET is mostly built around Microsoft products and it's not stable enough to live outside MS products.
>>
>>58178852
I don't do that at all. Right tool for the right job and all that.

I'm just pointing out that someone asked you why Python is not slow, and you response was that it is slow, but it doesn't matter. Sounds like something a silly person would say if you ask me.
>>
>>58178861
Doesn't Rust have reference counting? Which is a type of GC (although different from mark and sweep tracing GC in D).
>>
>>58178882
>mostly built around Microsoft products
In what way is this bad?

>not stable enough to live outside MS products.
Not stable how?
>>
>>58178892
That's like saying c++ has optional gc because of shared_ptr
>>
>>58178887
Yeah that was my reply.
Watch the presentation though. It's point is that languages aren't slow, implementations are, and ways we use languages are. There's for example an alternative implementation of the same language, python, which is faster than CPython, the official one.
>>
>>58178868
Depends on your library

Google what you use in #include <library.h> and study those with what they do
>>
>>58178892
RC is not GC

>languages aren't slow, implementations are
but that's wrong
>>
>>58178904
Are you asking why vendor lock-in is bad?
>>58178925
Uh, well yeah, that's true.
I don't understand why do people usually don't see RC as GC.
>>
>>58178933
>It's point is that languages aren't slow, implementations are
Oh I see now. You're autistic.

A langugae with nothing but slow implementations is slow.

Python is slow.
>>
>>58178791
And you can add GC to C++, but why would you? It's basically breaks the purpose of language, and none of libraries support it. And after that, you still have to manage you memory manually.
>>58178830
Wew, it's like you're still living in the early 2000s, all your arguments are outdated.
>Rust also has optional GC.
No it hasn't.
>Except when you want a kick-ass language.
There are no unique features about D, it's just a boring mid-2000s languages with nothing special going on.
>Not everyone wants to be closed in MS's world.
C# is an open-source language with permissive license that runs on all major platforms, and if you don't like it you can always use F#.
>Java Shitty language.
Then use Scala.
>being natively compiled, versus bytecode
Modern JIT compilers are very close to native codegen, the main reason of low performance of .NET and JVM comparing to C/C++ is GC, which D uses.
>>
>>58178961
>Are you asking why vendor lock-in is bad?
What vendor lock in? What's he talking about?
>>
>>58178904
>In what way is this bad?
If you don't mind it, .NET is nice.

>Not stable how?
Not enough time passed yet to use it in the wild (i.e. outside of MS ecosystem). That is why Java can't be beaten by .NET now.
>>
>>58178971
Scala is a shitty langugae. Arguably worse than Java in many respects.
>>
>>58178971
D macros aren't unique but are convenient
Unified function call syntax is nice.
>>
>>58178985
>Not enough time passed yet to use it in the wild
And how is this demonstrated in practice?
>>
>>58178995
How many Linux servers with .NET do exist?
And how many with Java?
>>
>>58178961
> I don't understand why do people usually don't see RC as GC.
Because manual RC isn't GC. There are GCs based on RC(shitty ones, like in perl), but you can use manual RC in assembler and C, that doesn't mean these languages have GC suddenly.
>>
>>58178966
Rather you're ignorant.
>>58178971
>There are no unique features about D, it's just a boring mid-2000s languages with nothing special going on.
Metaprogramming, for example. Also, a language doesn't have to be unique, it should be a good tool for a job.
>C# is an open-source language
2.0 is, later versions aren't (so no LINQ and other stuff).
>Modern JIT compilers are very close to native codegen, the main reason of low performance of .NET and JVM comparing to C/C++ is GC, which D uses.
Regardless, JIT will always be slower unless you have a special CPU like the one Transmeta made, and use more resources. Also, you can't write e.g. a kernel or kernel module in managed languages.
>>
>>58178961
>I don't understand why do people usually don't see RC as GC.

depends if the memory is freed as soon as there no more reference or not.
>>
>>58179025
Not sure, certainly some.

If you want to use .NET, you'll probably find it very appealing to use Windows instead. That doesn't imply linux is unstable though.
>>
>>58179048
>Rather you're ignorant.
You agreed with everything I said though.
>>
>>58179040
What do you mean by "manual RC"?
Anyway, shared_ptr counts references and when a reference count goes to 0, does a delete. It's an automatic process.
>>
>>58179071
>If you want to use .NET, you'll probably find it very appealing to use Windows instead.
That's what I am talking about.
>>
>>58179088
Why is that what you're talking about? How does people preferring to use Windows for .NET imply that .NET is unstable, and specifically unstable on linux?
>>
>>58179077
yes, but it's not collected, and it's not garbage

GC is when you say "I'll add this to a heap, and it will decide when to free it"
>>
>>58179131
It's garbage when reference count is 0 and it is collected via delete/free.
>GC is when you say "I'll add this to a heap, and it will decide when to free it"
That's called tracing GC and it's just one type of GC.
>>
>>58179048
> Metaprogramming, for example.
Like every other language since Lisp 1.5?
> Also, a language doesn't have to be unique, it should be a good tool for a job.
Language have to offer something interesting to the potential user, small unpopular language especially, and D is just pure boring.
>2.0 is, later versions aren't (so no LINQ and other stuff).
But you're wrong again: https://github.com/dotnet/roslyn .
> you can't write e.g. a kernel or kernel module in managed languages.
But we aren't talking about writing kernels. Then again, writing a kernel in a language designed around GC doesn't look like good idea either.
>>
>>58178440
They're stored as Latin1, sure, but are they transported across as such, or are they transported as say, UTF-16 (which is what Windows Vista used when Windows went Unicode)?

And I'm willing to be that Entity Framework communicates over plain old ODBC.

As for protocol it's propably TDS:
https://en.wikipedia.org/wiki/Tabular_Data_Stream

You now have some more information and can start digging even more. Happy hacking.

(Of course when you realize you can just measure it, you'll be mad you tried to precompute it, but that's life.)
>>
>>58179157
>It's garbage when reference count is 0 and it is collected via delete/free.
no.
>>
>>58179190
D is a system programming language offering extended meta-programming. The only other language like that that I know of is C++, but in C++ templates are ugly and more limited.
>But we aren't talking about writing kernels. Then again, writing a kernel in a language designed around GC doesn't look like good idea either.
GC can be turned off in D.
>>
>>58179235
r u s t
u
s
t
>>
I need women "programming" images please, thank you.
>>
>>58179157
No, tracing is a specific way of freeing it.
The point about garbage collection is that you're throwing memory into a bin to be collected, like a real garbage collector. Not that it will automatically de-allocate itself.
>>
>>58179247
OK, I have to dive into Rust some time. What's the best resource? Also, is it stable now?
>>
>>58179253
The point of GC is that the process of freeing up resources (memory, but not only) is done automatically and doesn't have to be explicitly programmed in.
>>
>>58179288
But it doesn't do it ITSELF. It's thrown into a BIN that does it.
>>
>>58178803
Dynamic typing!
But Common Lisp has it, and Common Lisp is retardedly fast.
>>
>>58179261
Not him but it is stable and the best introduction to the syntax and concepts is probably https://doc.rust-lang.org/book/
>>
>>58179314
https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Reference_counting
>>58179322
Dynamic typing isn't solely responsible.
>>
>>58178830
Why is Java a shitty language but C# is not?

What's the giant difference, except for the fucking namespace keyword?
>>
Why are Haskell shills so aggressive?
>>
>>58179346
RC is only considered GC by GC proponents
>>
>>58179077
> Anyway, shared_ptr counts references and when a reference count goes to 0, does a delete. It's an automatic process.
Yes, but it's automated at compile time, not run time, and the mechanism is implemented as regular types - neither language nor compiler know anything about reference counting going one. This is not GC, this is automated memory management.
>>58179235
>system programming language
>designed around GC
Not, it's a typical general-purpose language of its age.
>GC can be turned off in D.
And what features will you lose? Which third party libraries will work without it? I mean, yeah, you can turn it off, but nobody does that no this is not how it's supposed to be used, so why do it.
Also, then you have to revert back to manual memory management C++-style, and you might as well just use modern C++ because of better compilers, libraries, IDEs, larger community, without loosing anything critical. In contrast, Rust offers some actual alternative to GC/manual MM dichotomy.
>>
>>58179345
Thanks.
>>58179358
C# has both signed and unsigned integers, Java doesn't.
C# has properties, Java doesn't.
C# has operator overloading, Java doesn't.
And so on.
>>
>>58179122
If it was, we'd see more .NET servers, since Linux is more widespread.
>>
Do they sell USB-powered heated gloves? I can't program when my fingers are numb.
>>
>>58179288
> process of freeing up resources [...] doesn't have to be explicitly programmed in.
But with shared_ptr<> and Rc<> the process of freeing up resource IS explicitly programmed in by the guy who implemented the standard library.
>>
>>58179390
That makes no sense. Anyone who feels like using .NET can just install Windows and the server they use. It's not like there's people stuck on Linux.
>>
>>58179388
> unsigned integers
What is char?
Regardless, that's such a minute difference that nobody ever cares about.

> Properties
See:
https://projectlombok.org/

> Operator overloading
That's a thing in Java's favour. The whole overloading thing is fucking cancer.
>>
>>58179346
> https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Reference_counting
Again, there are GC based on RC, yes, but that doesn't mean every RC is GC.
>>
>>58179390
Breaking news - adoption is newer technologies is slow.

Corporations tend to have a policy of not spending millions of dollars and risking bugs when their current solution is still working for them.
>>
>>58179412
i agree that RC isn't GC but this is a retarded argument

GC doesn't grow on trees
>>
>>58179419
>can just install Windows
Yep, and that's not free.
>>
>>58179384
What's the difference between GC and automatic memory management?
>And what features will you lose? Which third party libraries will work without it? I mean, yeah, you can turn it off, but nobody does that no this is not how it's supposed to be used, so why do it.
You loose built-in maps and lists I think. But without that, it's still a C with extras.
>Also, then you have to revert back to manual memory management C++-style, and you might as well just use modern C++
As I said, metaprogramming is shit in C++. Also, C++doesn't have e.g. properties.
>better compilers
D has GCC front-end.
>libraries
Only good libraries have a C-compatible interface (they don't have to be written in C) and can be used in D just fine.
>IDEs
Emacs supports D.
>>
>>58179358
https://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
Overall Java is just too slow to adopt quality-of-live and functional stuff, but the main difference for me is the braindead generics in Java, in contrast with true parametric polymorphism with monomorphisation in .NET/C#.
>>
>>58179412
Yes, but it doesn't have to be programmed in by the programmer using said system. I.e. you don't have to do explicit freeing of resources with shared_ptr, it's done automatically when an object goes out of scope.
>>
File: tumblr_inline_nb7xtmbC9x1rjf1pv.gif (974KB, 500x281px) Image search: [Google]
tumblr_inline_nb7xtmbC9x1rjf1pv.gif
974KB, 500x281px
>>58174411
currently toying around with sarxos java webcam api.
So generally video recording is just snapping pictures really fast? desu I'm not sure what I was expecting
>>
>>58179487
and?
>>
>>58179451
>The whole overloading thing is fucking cancer.
Until you have to use a less standard numeric type (or class) and can't use natural infix operator syntax. Then you'll wish you had operators back.
That's not excusing stupid shit people do with overloading though
>>
>>58179468
> GC doesn't grow on trees
GC has to be implemented by compiler/platform, in contrast C++ or Rust language has no conception of GC, neither do their compilers or runtimes, hence "explicitly programmed".
>>
>>58179511
C# has added in a whole bunch of stuff, true.
But mindlessly adding bunches of things into Java is why the new releases have been so slow. 7 and 8 were mostly ergonomic releases, so things are going in the right direection. And 9 will FINALLY have Jigsaw, solving underlying problems with the language.

But I don't really see why people regard it as so much worse, when your quality of life in Java is 95% determined by the libraries and frameworks you use.
>>
>>58179451
Char is an integer type in Java?
>See:
>https://projectlombok.org/
We were talking about language features.
>The whole overloading thing is fucking cancer.
Kay.
>>
>>58179535
In that case I'd do:

NumberType.sum(NumberType... numbers);
And so on for the other operators.
>>
>>58179541
No it doesn't. You could just as easily have
std::gc_ptr<>
>>
>>58179552
>But I don't really see why people regard it as so much worse
Because it is measurably worse. And a lot of pain in directly inflicted on programmers by the poor design decisions in the langugae that C# was careful enough to avoid or implement properly.
>>
>>58179455
We had an anon some time ago who was setting new server.
It's not like he wasn't able to choose .NET, but he didn't, because .NET is not stable yet in Linux environment.
And AFAIK, some crucial components aren't free, so it lessens usefulness of .NET in Linux.
>>
>the following algorithm example assumes a big-endian system
eek
>>
>>58179568
Yes. char is an unsigned 16 bit integer.
Should you use it for that purpose?
Propably not.
But you can.

> We were talking about language features.
Being able to hook the compiler to provide better-than-C-but-not-quite-lisp macros isn't a feature now?
You can have the same thing as you have in C#, but you have to do it the Java way, with a compiler macro.
>>
>>58179388
>dat nitpicking
>>
>>58179576
Welcome to my world then. Don't forget the loss of comparison operators too. :'D
>>
>>58179603
show it
>>
>>58179625
See: >>58179511
>>
>>58179503
> What's the difference between GC and automatic memory management?
GC is a specialized subsystem that automatically collects leaked memory, AMM is an automated approach to MM in general. GC and RC are both AMM.
> C with extras
So is modern C++, the difference is cosmetic and isn't worth the effort of learning new language.
>>58179527
Yet it's not a part of a language or compiler itself.
>>
>>58179645
Type#equals(Object o) is always semantic equality, and == is always referential equality.

SInce these things are always granted we don't have to think about them.
>>
>>58179194
>Of course when you realize you can just measure it,

how, is there some software that measures received/sent queries?
>>
>>58179677
>the difference is cosmetic
No it isn't.
>>
how do I generate a song with code?
tensorflow?
>>
>>58179826
How advanced do you want to get?

Mathematica has some nice utilities for playing notes and stuff.
https://lab.open.wolframcloud.com/app/objects/wpl/RandomMelodies.nb
>>
>>58179826
It depends on the kind of your given output.
>>
>>58179864
just curious on all of this AI meme shit and want to learn.

I want to learn to maybe make something that sounds nice, not crap.
>>
>>58179826
There was some cringy Haskell dj at some event, google it
>>
>>58179677
>the difference is cosmetic
Partally, but their standard library offers different things, D has great support for contract programming, C++ doesn't offer anything like scope guards, you can choose if you want GC in D or not, D supports writing in a functional style if you want it. If you look more into D, you'll see they differ more than D looking like a nicer C++.
>>
>>58179885
State of the art is sample-level WAV generation via deep learning on about one million GPUs

https://deepmind.com/blog/wavenet-generative-model-raw-audio/

Scroll down to "Making Music".

If that's beyond your reach there are probably hundreds of "Use LSTM to generate MIDI" tutorials online.
>>
>>58179897
I'll also add that D has better template constraints
>>
>>58179897
>C++ doesn't offer anything like scope guards
There's a proposal to put them in C++20 IIRC.
>>
>>58179738

There are network monitoring tools that can do what you want.
>>
i know this is in php but it's more of a general OOP question. I don't quite see the benefit of going an OOP route. I can do this just fine without OOP. To me it seems like OOP makes things more readable. That's it. Can someone fill me in? Here's the OOP way of doing what i'm doing.
>>
>>58180031
>I don't quite see the benefit of going an OOP route
you're not the only one
>>
Anyone know a good Windows tool for remapping caps lock in vim only? I guess because of the way modifier keys work most seem to remap at the system level.
>>
What's opinion on Smalltalk?
>>
Is SDL a good multiplatform audio API or do I stick to PulseAudio?
>>
>>58180031
>To me it seems like OOP makes things more readable.
Yes, that's the point. As your code base gets bigger, readability becomes increasingly valued.
>>
File: money.jpg (69KB, 1680x1050px) Image search: [Google]
money.jpg
69KB, 1680x1050px
How long would it take to program a game like this?
>>
>>58180193
Do you know about portaudio?
>>
>>58180315
a few days I guess, depending on how talented you are.
>>
>>58180335
Doesn't have a stable release since 2011. Is it still trustworthy?

>>58180315
It depends. Do you know how to program OpenGL shaders?
>>
>>58178777
>There is basically no reason to use D right now,
Yes, there is. It's called LDC2.

>if you want GC language you'd be much better off with C# or Java.
Fuck off with your VM JIT shit.
>>
>>58179895
>Haskell dj
MC Monad: purest beats in town!
>>
>>58180375
I didn't know the last stable release is this old. But anyway it's portable and very easy to use.
>>
>>58180335
It works, though it doesn't provide more than basic audio wrappers.
>>
>>58180375
Oh wait, should've checked.
>This is the most current and stable release from the Git repository on October 30, 2016
>>
>>58180349
>>58180375
I was just curious, since the guy who made that is probably a millionaire now.
>>
>>58180437
Nice. I'll give it a try.
Thanks.
>>
>>58180441
i figure it took him a few months. Probably not hard to make something like that, but making it feel as refined and as polished as that is what takes that vast majority of the time.
>>
>>58180390
> Yes, there is. It's called LDC2.
So they have second-tier implementation what uses LLVM for codegen, just like everybody else. I can't see how it's a reason to use D.
>>
Anybody looking for a c++ project to work on? commission based payment terms
>>
Currently I'm fucking around in Ada SPARK and making an IO Pool https://gitlab.com/linted/linted/blob/master/src/ada-core/src/linted-io_pool.adb
>>
>>58180587
Perhaps. What's the project?
>>
>>58180226

is there a need for OOP if you have no database then...? if i'm not gonna "map" my data with classes, then why use OOP?
>>
>>58180775
It can make your code more readable. You don't *need* it. but some will argue it's useful sometimes.
>>
>>58180771
Shitty niche program for kids. More infos here >>>/biz/1687705
>>
>>58180775
>is there a need for OOP if you have no database

Databases and OO are painful to get working together because relational databases + SQL are perfect and elegant technology, while OO is a containment ghetto for shitty programmers.
>>
>>58180931

Except that ORM is fucking incredible and you should kys.
>>
File: 1440865377371.jpg (1MB, 3072x2304px) Image search: [Google]
1440865377371.jpg
1MB, 3072x2304px
>mfw fired
>mfw can't do a thing because I wasn't officially employed
It's time to get meme degree.
>>
>>58181015
>ORMs
>Intentionally degrading the beauty of SQL to OO degeneracy
>Preventing programmers from seeing the light by hiding it

Disgusting
>>
>>58181058

DELET THIS!!!!
>>
I have been looking through somebody else's C code and he's using what's ostensibly a linked list, except the implementation is different from what I'd normally expect. Instead of an array of elements/pointers to elements each coupled with a pointer to the next/previous element(s) in a struct, he has one array with all the elements (in the order of being added) and another array of structs storing the INDICES of each element and next element.

My questions are:

1) Is there a name for this sort of implementation?
2) Does it have any advantages?

I can see some drawbacks, e.g. you can't really remove (or at least deallocate) elements in O(1), though the code I'm looking at doesn't delete individual elements and indeed doesn't even implement such an option.

I'm not sure I'm right in even calling it a linked list. The code doesn't, but it has a problem-specific name so that's not much of a guide.
>>
>>58180104
Ruby with a weird syntax.
>>
File: null.png (70KB, 302x392px) Image search: [Google]
null.png
70KB, 302x392px
>>58181015
>OSGTP
>hur duh ORM is muh awesum kys desu
Annnnd filtered.
>>
>>58181120

*kisses you back*
>>
>>58181109
Also I'm sure the person who wrote it can into "proper" linked lists so I'm sure there must be some advantage to doing it like that but I can't figure it out.
>>
Recommended platform/IDE for learning C++?
>>
>>58181220
Gentoo/emacs
>>
>>58181120
Please don't acknowledge that a poster is using a trip. You are just as big a problem as they are.
>>
>>58181220
QtCreator.
>>
>>58181220
Code::blocks.
>>
What's the best way to get started with OpenCL? I want to play around with neural networks too
>>
>>58181230
>>58181278
>>58181283
thanks, ima check em out
>>
>>58181015
ORM is only "fucking incredible" if your database tables map to domain objects 1:1 which is almost never, unless your database model is disgustingly denormalized, or
your domain logic is one hell of a mess. In all other cases you usually find yourself wrestling with the ORM only to end up with terribly inefficient queries on top of already inefficient ORM abstraction layer.
>>
>>58181109
https://en.wikipedia.org/wiki/Linked_list#Linked_lists_using_arrays_of_nodes

I've done it for the trivial serialization once or twice.
>>
>>58181327
I personally like the F# SQL type provider. It can just parse SQL statements at compile time and figure out what types they will produce, and return static versions of those types.

SQL in all langugaes should work like this.
>>
>>58181412
>not just using dependent types
>>
>>58181109
I can see it being done for performance (caching/smaller memory footprint) and also for not using memory allocations which might be useful for a kernel or other restricted environment but I would see little other reason.
>>
>>58181552
That's effectively how this works i think.

How would things be any different with dependant typing?
>>
>>58181578
Serialization. You can slap that straight into a file (or generally anywhere, e.g. through a socket) then back into memory with no extra work required.
>>
>>58181588
dependent types could work with runtime values
e.g. you could demand the user input conforms to a schema that's only known at runtime
>>
>>58181632
Don't get it. That sounds like dynamic typing.
>>
Any Programming related feeds you find interesting?
>>
>>58181648
it's not dynamic typing.
>>
File: lena_to_text.png (50KB, 512x512px) Image search: [Google]
lena_to_text.png
50KB, 512x512px
What if Lena were text?
>>
>>58181604
>>58181578
Implementing it as separate arrays is also less "intrusive" than the way shown on Wikipedia since the data is fully split from the order, so you could have multiple different linked lists using the same data (e.g. many alternative orders or subsets of some data set) and you could print out all your data directly if there's an instance where the order either doesn't matter or the order in the array is some privileged immutable order.
>>
How can I do recursion with lambda functions in java
I need a way to call my lambda function again
>>
>>58181755
What if you remembered to forget your trip?
>>
>>58181774

Stop bullying please.
>>
New thread:

>>58181779
>>58181779
>>58181779
>>
File: Untitled.png (1MB, 960x1040px) Image search: [Google]
Untitled.png
1MB, 960x1040px
>>
>>58181686
Well dynamic typing can do that. What's the use of that anyways?

What's the point if it only can know the schema at runtime? How does that work?
>>
>>58181755
Where's the real OSGTP gone? This imposter is posting white women.
>>
>>58181774
>>58181240
Thread posts: 316
Thread images: 19


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.