Jump to content

How to start coding in more profesional compilers.

Tedstonegenious

Most of my programming history was with Javascript and LUA. But the only time I've been able to use them is with KhanAcademy's and computercraft's built-in compiler respectively. And they work great. But what I can do is rather limited. So I've been trying to use a more of an actual compiler. I tried to install Eclipse version photon onto my computer, but even when I use it to directly run code from someone else,  Like this official ltt story generator from this page. I just downloaded it and told it to run through the compiler.  But it still spits out an error. In this case, it says something about not finding an ant file. How do I set up an environment it to work properly?

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Tedstonegenious said:

So I've been trying to use a more of an actual compiler.

Maybe you need an actual programming language first.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

You can write javascript in any text editor like notepad (or notepad ++ if you like line numbers like me.)
Same with Lua.

However Javascript can also be compiled using Node.js. This is a technology created for web developers to write server code without needing to learn a separate language to the client.

You could also

11 hours ago, Dat Guy said:

Maybe you need an actual programming language first.

Some popular "actual languages" are C++, Java, & COBOL.


Visual Studio supports C, C++, C#, Basic & has plug ins that let you write Node.JS, python & more.

 

Java imo is overly complicated & doesn't make sense to me in how it became popular.
Java needs you to install Java (Java Runtime Environment I believe) then you need to install a compatible compiler like Eclipse & then you may have to do some configuring. You'd then open Eclipse to write your code. You can also use other IDE like DR Java.

 

Other popular compilers:
Dev C++ (C++)

Pelles C (C)

XCode (Apple's IDE. Supports many languages. I don't know it.)

Linux also has a compiler built in or something. With Linux, you use any text editor you want. Then you go to the command line/terminal for Linux (Like the command prompt on windows) & type in a command to compile the program. I don't know what languages or how many built in compilers there are supported. The Linux section should show some promise if you inquire however, I'd say Googling some information will likely bring you some good luck.

 

Is there any particular language you were hoping to move to or were you hoping to compile Javascript or Lua?

As an addendum, you can compile Lua with a few game engines like Leadwerks (has a free demo)

https://www.leadwerks.com/

You can also write Lua to create mods for Garry's mod
https://wiki.garrysmod.com/page/Category:Lua_Tutorials

 

As for Node, you can write some Discord bots using the api & node. I'm fairly certain most node js discord bot youtube guides will show you how to install node JS. Otherwise you could use a technology like WAMP to create web apps & run them on your computer.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, fpo said:

 

 

Java imo is overly complicated & doesn't make sense to me in how it became popular.
Java needs you to install Java (Java Runtime Environment I believe) then you need to install a compatible compiler like Eclipse & then you may have to do some configuring. You'd then open Eclipse to write your code. You can also use other IDE like DR Java.

 

 

Eclipse is not a compiler, Java virtual machine only compile the performance critical section of the java bytecode. The rest is interpreted like JavaScript and python interpretor. 

 

Java isn't the most compliacted langauge. C++ earns that title by far. It is object oriented but with all those legacy C sythax on top.

 

 

Linux should have C/C++ complier and python interpretor built in but don't take it for granted. Some minimum install distro require you to install these packages manually e.g. base-devel when using pacstrap on Arch or on pacman if you did not include it during install. It is necessary for AUR since many of the packages there are literally raw source code. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, wasab said:

Java isn't the most compliacted langauge. C++ earns that title by far.

Have you ever tried writing an application in APL? ;)

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Nope, I was wanting to use eclipse as a compiler. I already got it installed for Java javascript, and C++; But even if I use source code from other people, It still spits out errors. 

Link to comment
Share on other sites

Link to post
Share on other sites

19 hours ago, fpo said:

Java imo is overly complicated & doesn't make sense to me in how it became popular.

1

Java became popular as it had the ability to be compatible with several machine architectures while only compiling the code one. This was important because it was originally developed as a way to make web pages interactive. 

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, Tedstonegenious said:

Java became popular as it had the ability to be compatible with several machine architectures while only compiling the code one. This was important because it was originally developed as a way to make web pages interactive.  

Javascript was developed to make interactive web pages.

 

Java was originally intended to be a very portable application language, even to embedded processors. I think it fell pretty short of that goal, but i guess technically it will run on any processor/host OS for which there exists a JVM and sufficient memory, but the generalized version of that statement is true for any language.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

59 minutes ago, Tedstonegenious said:

Nope, I was wanting to use eclipse as a compiler. I already got it installed for Java javascript, and C++; But even if I use source code from other people, It still spits out errors. 

They may be using api you don’t have installed. 

 

Did you try writing hello world programs? 

Spoiler

C++

		

		#include <iostream>		

		using namespace std;		

		int main () {		

		int x;		

		cout << “hello” << endl;		

		cin >> x;		

		}		

you can use printf and scanf if you want. Cout and cin are Just shorter/less complex so I use those when I’m using c++

I forget how to write java & JavaScript hello world. 

 

You may need to crate a console application specifically. 

 

What OS do you have? 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, straight_stewie said:

Javascript was developed to make interactive web pages.

 

Java was originally intended to be a very portable application language, even to embedded processors. I think it fell pretty short of that goal, but i guess technically it will run on any processor/host OS for which there exists a JVM and sufficient memory, but the generalized version of that statement is true for any language.

Well, I guess you can say that now. But Java was the first to be able to do this. And while the Java and Javascript para-dime ended like that, java WAS DEVELOPED FOR WEB BROWSERS. its first appearance was on a clone web browser that used the then proprietary technology to make rectangles periodically move. You may have been confused as it was called green at the time. And later renamed to Java when the technology was bought by Oracle. javascript was developed as a simpler language for more novice programmers. But as it developed and became more and more capable, Javascript ended up replacing Java in the web browser market.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Tedstonegenious said:

java WAS DEVELOPED FOR WEB BROWSERS

Every article/blog/post I read (including Oracles own "Java timeline") about it says that James Gosling invented it as "greentalk", then "oak", now "Java" as a multiplatform programming language designed to make programs for consumer electronics: Or in other words, a portable, platform agnostic language for embedded computing.

The reason it has history being an internet technology is two-fold. First, after seeing virtually no success in the embedded field, Sun decided to use it to make a web browser, and secondly, independent of either Sun or Oracle's intent, Netscape decided it would be nice if web developers could target it to make dynamic websites.

Java was originally invented, quite literally, to run smart home devices. It just never worked out that way.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, Tedstonegenious said:

And later renamed to Java when the technology was bought by Oracle.

In addition to what @straight_stewie said, it was called java well before it was bought by oracle.

 

also, don't confuse java the language with java applets, which were built on java the language.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, straight_stewie said:

Javascript was developed to make interactive web pages.

 

Java was originally intended to be a very portable application language, even to embedded processors. I think it fell pretty short of that goal, but i guess technically it will run on any processor/host OS for which there exists a JVM and sufficient memory, but the generalized version of that statement is true for any language.

still waiting for microsoft .net to be as portable as java. would that day even be possible? 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, wasab said:

still waiting for microsoft .net to be as portable as java. would that day even be possible? 

The full .NET library will be fully portable the day windows switches to the Linux Kernel.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, reniat said:

In addition to what @straight_stewie said, it was called java well before it was bought by oracle.

 

also, don't confuse java the language with java applets, which were built on java the language.

also dont confuse the java programming language with java, the bervage thats made using grounded coffee beans.

I have heard of stories of someone showing up for a java job interview and was like "oh, i thought you meant making coffee...."
 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

I wrote this before realizing that might not have been what OP meant. Gonna leave it here since it seems I can't delete my own post:

Quote

 

Hold on, what makes you think of Javascript as not "professional"?

 

A professional is someone who makes a living performing a specific kind of job. Software development with Javascript certainly falls into this category - many companies would pay you good money for doing it (some of them, *very* good money).

 

If you're not interested in making money this way, or just want to try out new languages, that's fine! But please don't let anyone saying something along the lines "lol javascript is for n00bs" affect your judgement.

 

 

Edited by nicebyte
Link to comment
Share on other sites

Link to post
Share on other sites

Both JavaScipt and Lua are interpreted languages (though apparently JS can be compiled as per above comments), so neither require a compiler. Since you're referencing Eclipse, I'm assuming what you actually mean is that you want to start using an IDE.

 

Without an actual error message it's hard to help, and IDEs often require some to moderate amounts of setup effort from your end to work properly. It can also be you just have not set up your project correctly.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

JavaScript cannot technically be "compiled" into an executable file - it can only be compiled to bytecode which needs to be "interpreted" in a dedicated virtual machine, similar to Java and, of all things, Perl 6.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Dat Guy said:

JavaScript cannot technically be "compiled" into an executable file

If we're being pedantic, there are tools which take interpreted languages and generate an executable for a given target

 

You obviously lose a good chunk of the level of efficiency you get when compiling lower high level languages (C/C++), but there are advantages. This is how native applications are made using interpreted frameworks (e.g. Electron apps written in node JS), and as long as the platforrn is well supported, you can get a wide array of targets for free. It's kind of like combining interpreted languages and CMake.

 

Sure you can (and should) get free cross platform compatibility in languages like C/C++, but in cases like electron, you get the advantage of also having a very robust GUI framework essentially built in. As much as I love C/C++, "native powerful GUI" is not exactly a selling point of the language (nor should it be, they are different tools for different purposes).

 

This is one reason desktop applications are moving in this direction, since you can make fast native apps with a UI that looks identical on all platforms, since you can have the same UI framework running on the same rendering engine (e.g. V8 in the case of electron), and bypass most of the annoying web browser nonsense of webdev ui work.

 

Slack, Spotify, VSCode, the Docker client, Discord, the Messenger desktop app, are all high profile examples of modern apps built using specifically Electron.

 

@Tedstonegenious I go into this much detail to help convey the info that the compiler you use actually has very little bearing on your first hand experience a good portion of the time, unless you are working at a low level. You can make desktop apps in C, assembly, or javascript. Compilers are DEFINITELY worth learning about, and I'd expect anyone who claims to be a "Java expert" to know a good bit about the JVM for example, but I would focus less on the "under the hood stuff" as you just start out with learning. Start by getting hang of the fundamentals of writing clean code, correct logic, using data structures, etc.

 

So to answer:

On 1/21/2019 at 9:44 PM, Tedstonegenious said:

But what I can do is rather limited

this only applies to the dev environment in Khan acadamy, and in fact you can do quite a bit with things like Javascript. Does that mean you should always use JS? No, but every tool has a purpose and it's always best to use the right tool for the job.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

17 hours ago, tikker said:

IDEs often require some to moderate amounts of setup effort from your end to work properly.

Yikes. What kind of IDE do you use that require more than double click setup Next/Next/Next/Finish double click icon, code ?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×