What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
Thank you for using an anime monad!
How can I tell if some language is a scripting language?
It being dynamically typed already means it's both "scripting" and "shit".
What if the language is object-oriented?
Can I call it a scripting language?
If it doesn't have to be compiled?
But that's what makes language interpreted though.
It's it makes it easy to do useful things in very few lines of code.
anyone here uses nuklear.h gui lib?
i need a C gui lib i can skin to be all sexy and material. will i be able to with nuklear.h?
>sexy
>material
Please don't
what are your opinions on how constexpr variables in file/namespace scope should be named? like do you think they should be in camelCase or in FUCK_YOU_CASE? i'm tempted to do FUCK_YOU_CASE because they're used in the same way as a #define constant would be, and it makes them easier to distinguish from run-time camelCase variables so you know it's a compile-time value when looking at code that uses it, and it's consistent with the naming convention of class-scope static final variables in java.
> Forth, Haskell
> scripting
what are you on?
this especially if it's not on android
Rather than few lines of code I should have said little amount of work. Also not just some useful things but pretty much anything high level. If that's still true for haskell then yes I'd call it a scripting language. The clue is that a scripting language is not mutually exclusive with other types of languages. Some languages can be good at both scripting and more "serious" programming. Not sure if that applies to haskell etc though as I haven't used it.
Awk or Perl?
But haskell is compiled and forth is high level after 8-16 words depending on what you're working on (and it's compiled too).
it's almost as if you'd call x86 a scripting language when comparing it to arm due to the feature set
Being interpreted is not a requirement for being a scripting language. And i don't get your instruction set analogy
How do we make a scripting language that doesn't suck?
>what is lua
Are the Motorola 68k microprocessors still used in anything?
I'm taking a class next quarter on Computer HW & Organization, and one of the textbooks is on that chip. I thought that was kind of a goofy choice.
And how is Lua in bare environment?
Let's say, can I make a web server in Lua?
Running legacy JBoss for uni project.
It's run on Java 8, although it shouldn't.
Should I be worried?
*It works with
As far as I know, m68k is widely used among microcontrollers.
>And how is Lua in bare environment?
As long as you have C you can then add Lua as it has low requirements. That is one of its strengths
>Let's say, can I make a web server in Lua?
Possible, it exists, but it's niche
Well, and how about a general-purpose scripting languages?
Forth is a systems language meant to run without an OS... it is the OS in most cases
Haskell is a system for writing large and complex programs correctly
Then they don't "make it easy to do useful things in very few lines of code." as was my first requirement
Having to do that just to get declarations closer to statements that use them may well be the symptom of a function body that is getting too large. You can avoid that by splitting the function body into shorter functions.
I have the same problem in C++, because I don't want to get too many methods in my classes, but then I end up with gigantic methods with declarations all over the place. Eventually, while refactoring, I split the code inside public methods into shorter private methods. This way, it's even easier to define constant references at the start of the private methods to get more concise code afterwards.
I remember Java keeping backward compatibility, so new Java should run old Java code.
I'm trying to write a simple file transfer program in Java using TCP Sockets.
I'm apparently not understanding how I/O streams work. Eclipse is telling me I need to cast a socket's getInputStream() as an InputStream in order to use it as such. Does getInputStream() not return an InputStream?
Aw fuck, ignore me. I'm retarded and imported the wrong InputStream LOL
What do you mean? Lua is pretty general-purpose.
should be ok. i can't think of anything that breaks backward compatibility off the top of my head
>matlab/octave and mathematica are all shit
okay
I'm trying to design syntax that appears algol-like but is actually homoiconic like Lisp.
How does this look?
fact : fn(int.t) -> int.t;
fact = fn(x) {
let {
aux : fn(int.t, int.t) -> int.t;
aux = fn(n, a) {
cond
[n == 1] { a }
[else] { aux(n - 1, a * n) }
}
};
aux(x, 1)
}
Trying to make a CHIP 8 emulator and am learning how to do graphics using SDL.
I have a question... When I run the following code, pic related appears (a white rectangle shows up instead of the pattern I draw), what should I be doing instead?
int main(int argc, const char * argv[])
{
SDL_Window* gWindow = NULL; //Window we'll render to
SDL_Surface* gScreenSurface = NULL; //Surface contained by the window
if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
printf("SDL cound not initialize! \n\t SDL Error: %s\n", SDL_GetError() );
}
else
{
//Create Window
gWindow = SDL_CreateWindow("SDL Tutorial",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_WINDOW_SHOWN);
if( gWindow == NULL)
{
printf("WINDOW Coulnd't initialize! SDL_Error %s\n", SDL_GetError());
}
else
{
//Get Window Surface
gScreenSurface = SDL_GetWindowSurface(gWindow);
SDL_FillRect(gScreenSurface, NULL, SDL_MapRGB( gScreenSurface->format, 0xFF, 0XFF, 0xFF)); //Fill screen white
SDL_UpdateWindowSurface(gWindow); //Update surface
}
}
std::cout pixels + x + y;
*pixmem32 = color;
}
You're only calling SDL_UpdateWindowSurface once.
Alright... I added SDL_UpdateWindowSurface(gWindow);
after the drawPattern() call, but it didn't seem to do anything... Is there a way i can update the SDL Window with a given SDL Surface?
So how do cookies work with libcurl?
I've performed my POST request and logged in, now how do I make subsequent requests so that the server knows I'm logged in?
>what should I be doing instead?
using sfml
does c have anything nice besides messing with pointers and function pointers?
There appears to be some kind of C revival going on. Now all the python shits are trying to use it.
"messing with pointers" grants you a lot of power.
If you want to learn to be a wizard in C though, master the preprocessor.
for programming they're definitely shit. they're good for mathematical computation where you're mostly just dealing with numbers or lists of numbers so you don't care too much about the type
C++ has everything C has and more
Yes.
You can also call it worthless.
Sometimes less is more.
Fuck C++.
Except coolness.
C++ is fine but using most of its features can get quite bothersome rather fast.
C++ really fucked by trying to be so much. If it had just been "C with classes," it might have been pretty nice.
Ew fuck no.
/dpt/ has been C turf for years cunt fuck off culture critic fagnutz!!
What I dislike is how it's doing so many things behind your back (did you just use an overloaded operator on a non-POD datatype? enjoy the 15 constructor calls) when it could do so with less overhead. This is much more unnerving than the excessive amount of features. But I don't fancy the way some people in /dpt/ dismiss anything C++ just because it's C++ either.
No. M68k is the standard for teaching because its easy. Old tech otherwise.
We had MIPS which feels even less used. M68k can be used for some calculators at least.
Hey Sup Forums I'm having trouble reproducing this code from my lecture class. The prof. wrote it in one file but I'm trying to separate it into multiple files but I'm getting a link error. I'd reckon this doesn't count as being homework related since it's more of trying to understand the lecture.
Thanks in advanced
Don't include resource.cpp in main. Functions are declared in Header.h when compiling the main translation unit, symbols are then resolved at link time.
What's all this about with scalaz and a code of conduct?
Since C doesn't support switching based on a string, would creating an array of strings, comparing the input to each one, returning the index of the matched string, and using that for a switch statement be viable way of implementing it, if you just really didn't want to use an else if chain for some weird reason?
You mean iterating through the array, returning the first index for which strcmp returned zero? Should work.You'd have to keep the indices and strings in sync, might be better to have a structure like
static const string_ids[] = {
{ STR_HELLO, "Hello" },
{ STR_HOWDOYOUDO, "How do you do" },
{ STR_GOODBYE, "Goodbye" },
};
and return the STR_ enum value associated with the matched string, that way it's less easy to let them get out of sync.
I need to learn PHP for some upcoming jobs but I don't know where to start, I usually learn a language by doing projects that will test my understanding of the language but this is my first web language and I don't know where to start. Any suggestions?
Welp I messed up the declaration (forgot the type) but you get the idea.
The first option is slightly less efficient but better design.
void foo(const char *input, size_t n) {
switch(getbar(input, n)) {
case fizz: ...
}
}
I think knows better.
A book or tutorial is always a good place to start
He got an email from some guy with an mit.edu email
Beautiful flowers, aren't they?
Forgot about them, thanks
++++++++++[>+++++++>++++++++++>+++>+.
Pluralsight/team tree house
not that hard. look for a tutorial on it, like any other language. this time you make a web folder where you can also put html files and install wamp.
Replace the square with a cute anime girl, or at least one would look like if they were a square.
That's actually a rather smart and well-done way to render pixel flowers, I like it a lot.
parse error: "what" expected
Replace the square with a cute anime girl, or at least one would look like if they were a square.
^
Thanks!
Good job, you managed to pick up by error based on context.
Congratulations for proving that you recognise language.
Do you want a fucking medal?
Neat.
kindness error: rudeness detected
Do you want a fucking medal?
^
parse error: "my" expected
Good job, you managed to pick up by error based on context.
^
parse error: All euros should be euthanized
Congratulations for proving that you recognise language.
^
parse error: Rude language, please revise
Do you want a fucking medal?
^
this 2bh
thanks pal
Would you be inclined to go fuck yourself, were I to ask you to do so?
only if you provide the lube, bb
>lube
>Having a mutilated dick
Oh, I thought you wanted to put it in my butt
>MIPS which feels even less used
Back in the late 90s, early 00s, MIPS was king for game consoles. These days, it's mostly used for some routers and a couple of IoT devices.
Please respond.
I've made a KISS hand-written LL(1) parser, don't know what I'll do with it yet.
>All euros should be euthanized
Wut.
s instead of z
Why the hell would you think I was European for typing that, you stupid American?
I'm not him.
If you prefer to program in C over more modern languages you are literally autistic.
free() yourself
I prefer to program in C and OCaml.
>i-i'm akshually british, not european
keep deluding yourself lmao
brits are absolutely european
I'm not British, though.
I'm about as far away from the EU as you can get.
Straya?
Kiwi?
Obviously, you fucking reddit spacer.