# Program structure

**URL:** <https://discourse.julialang.org/t/program-structure/30376>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 27, 2019, 8:50pm UTC](https://discourse.julialang.org/t/program-structure/30376 "2019-10-27T20:50:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ebtissam](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Ebtissam](https://discourse.julialang.org/u/Ebtissam)\
**Post date:** [October 27, 2019, 8:50pm UTC](https://discourse.julialang.org/t/program-structure/30376/1 "2019-10-27T20:50:32Z")

</div>

Hello everyone  
i am new to Julia language i need help regarding program structure of Julia language. (What is the program structure of Julia language?)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 27, 2019, 8:51pm UTC](https://discourse.julialang.org/t/program-structure/30376/2 "2019-10-27T20:51:31Z")

</div>

please be less vague…

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![Karajan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/karajan/32/8545_2.png) [@Karajan](https://discourse.julialang.org/u/Karajan)\
**Post date:** [October 28, 2019, 8:02am UTC](https://discourse.julialang.org/t/program-structure/30376/3 "2019-10-28T08:02:52Z")

</div>

Welcome, first of all!

To me it is not very clear what you would like to know. The “program structure” can mean a lot of things, could you explain what you want to know or what you are trying to do? If it’s easier, maybe an example from a different language so we can understand what you are aiming for.

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [October 28, 2019, 8:46am UTC](https://discourse.julialang.org/t/program-structure/30376/4 "2019-10-28T08:46:27Z")

</div>

> [@Ebtissam](#):
>
> i need help regarding program structure of Julia language. (What is the program structure of Julia language?)

I’m gonna get philosophical here. a program is, by the [cambridge dictionary](https://dictionary.cambridge.org/dictionary/english/program):

> _A series of instructions that can be put into a computer in order to make it perform an operation_

so,using the strict definitions, the structure of a program is the way in which the instructions are arranged or organized so you can perform an operation. In this case, a julia program has julia instructions (defined by the julia syntax) and how do organize and execute those instructions are the structure of a julia program.

Lets write a simple program. Julia instructions (“Julia Code”) are executed by reading text contained in files. in Julia’s case, the `.jl` extension signals that the file contains Julia code. lets create a simple example. a file named `example.jl` with the following content:

```julia
#commentary. doesn't get executed
a = 2
b = 3
c = a+b
prinln(c)
println("hello world")

```

this is a series of valid julia instructions that can be executed. Now, how do we execute those instructions? there are some ways to do that:

1. You can call the Julia binary to execute that file. (when you install Julia, you basically install a Julia interpreter, in the sense that interprets Julia syntax and transform Julia instructions to computer instructions). in the terminal:

```julia
$ julia example.jl

```

1. You can call a Julia session, and execute your program inside that session:

```julia
$ julia

               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.2.0 (2019-08-20)
 _/ |\ __'_|_|_|\__'_| |  
|__/ |

julia> include("example.jl")

```

1. you can compile your program and run the executable (i don’t know how to do this, as this is a functionality not included in the language right now, but there is a [package that tries to do that.](https://github.com/JuliaLang/PackageCompiler.jl). (an executable is directly computer instructions)

after all this, a lot of questions are still left unanswered:

- What is the julia syntax?
- How do i interact with the rest of the computer?
- How do i interact with other computers?
- How do i interact with other programs?
- How do i save and load my work?
- How do i order all the variables in my program?

I don’t know the answer of all those questions, but in this community there is people that can. feel free to ask!. a great starting point is the [official julia docs](https://docs.julialang.org/en/v1/manual/getting-started/).

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [October 28, 2019, 8:47am UTC](https://discourse.julialang.org/t/program-structure/30376/5 "2019-10-28T08:47:24Z")

</div>

just asking, you asked this on Stack Overflow, right?

---

<div class="post-metadata">

**Author:** ![Ebtissam](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Ebtissam](https://discourse.julialang.org/u/Ebtissam)\
**Post date:** [October 28, 2019, 8:04pm UTC](https://discourse.julialang.org/t/program-structure/30376/6 "2019-10-28T20:04:27Z")

</div>

Thank you very much for helping me .

---

<div class="post-metadata">

**Author:** ![Ebtissam](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Ebtissam](https://discourse.julialang.org/u/Ebtissam)\
**Post date:** [October 28, 2019, 8:05pm UTC](https://discourse.julialang.org/t/program-structure/30376/7 "2019-10-28T20:05:06Z")

</div>

Right
